PowerShell kullanarak SharePoint'teki Tüm InfoPath Liste Formlarını Bulun
Gereksinim: SharePoint'teki tüm özelleştirilmiş InfoPath liste formlarını bulun. Bir geçiş projesi sırasında SharePoint web uygulamasında özelleştirilmiş tüm InfoPath Listesi formlarının bir listesini raporlama görevi verildi.
SharePoint'teki Tüm InfoPath Liste Formlarını Bulmak için PowerShell Komut Dosyası
InfoPath'in SharePoint 2016 ve Office 365'te kullanımdan kaldırılmasıyla birlikte, InfoPath formlarıyla özelleştirilmiş tüm listeleri SharePoint ortamımızda bulmak istedik. Bu blog yazısında, SharePoint site koleksiyonlarındaki tüm InfoPath liste formlarını bulmak için PowerShell'i nasıl kullanacağınızı göstereceğiz.
Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Configuration parameters
$WebAppURL="https://intranet.crescent.com"
$ReportOutput="C:\InfoPath-ListForms.csv"
#Array to Hold Result - PSObjects
$ResultColl = @()
#Get All Webs of the Web Application
$WebsColl = Get-SPWebApplication $WebAppURL | Get-SPSite -Limit All | Get-SPWeb -Limit All
#Iterate through each web
Foreach($Web in $WebsColl)
{
#Get All Lists with InfoPath List Forms in use
Foreach ($List in $web.Lists | Where { $_.ContentTypes[0].ResourceFolder.Properties["_ipfs_infopathenabled"]})
{
Write-Host "Found an InfoPath Form at: $($Web.URL), $($List.Title)"
$Result = new-object PSObject
$Result | add-member -membertype NoteProperty -name "Site URL" -Value $web.Url
$Result | add-member -membertype NoteProperty -name "List Name" -Value $List.Title
$Result | add-member -membertype NoteProperty -name "List URL" -Value "$($Web.Url)/$($List.RootFolder.Url)"
$Result | add-member -membertype NoteProperty -name "Template" -Value $list.ContentTypes[0].ResourceFolder.Properties["_ipfs_solutionName"]
$ResultColl += $Result
}
}
#Export Results to a CSV File
$ResultColl | Export-csv $ReportOutput -notypeinformation
Write-Host "InfoPath Lists Forms Report has been Generated!" -f Green
Bu komut dosyası aşağıdaki gibi bir CSV çıktı raporu oluşturur:
İlgili Gönderi: SharePoint'teki tüm InfoPath Form Kitaplıklarını bulun
