PowerShell kullanarak SharePoint Online'daki Tüm InfoPath Form Kitaplıklarını Bulun
Gereksinim: SharePoint Online'da Tüm InfoPath Form kitaplıklarını bulun.
SharePoint Çevrimiçi Sitesindeki Tüm InfoPath Form Kitaplıkları Nasıl Bulunur?
SharePoint Online'da InfoPath formları, InfoPath formlarını depolamak ve yönetmek için tasarlanmış özel belge kitaplığı türleri olan form kitaplıklarında depolanabilir. SharePoint Online ortamınızda tüm InfoPath form kitaplıklarını bulmanız gerekiyorsa PowerShell'i kullanabilirsiniz. Bu eğitimde, PowerShell kullanarak SharePoint Online'daki tüm InfoPath form kitaplıklarının nasıl bulunacağını tartışacağız.
SharePoint Online site koleksiyonundaki tüm form kitaplıklarını almak için aşağıdaki PowerShell betiğini kullanın. Bu komut dosyası, herhangi bir listenin şablon kimliğinin 115 olup olmadığını kontrol ederek bunun bir XML Form Kitaplığı (SharePoint Çevrimiçi Liste Şablon Kimlikleri Referansı) olup olmadığına karar verir.
#Function to Get Form Libraries
Function Get-PnPFormLibraries
{
[cmdletbinding()]
param(
[parameter(Mandatory = $true, ValueFromPipeline = $True)]$Web,
[parameter(Mandatory = $true, ValueFromPipeline = $False)][String] $CSVPath
)
Try {
Write-host "Searching Web '$($Web.URL)'" -f Yellow
#Get All Form libraries
$Lists= Get-PnPProperty -ClientObject $Web -Property Lists
$FormLibraries = $Lists | Where-Object {$_.BaseTemplate -eq 115 -and $_.Hidden -eq $false}
#Export Form Libraries Inventory to CSV
If($FormLibraries.count -gt 0)
{
Write-host "`tFound '$($FormLibraries.count)' Form Librarie(s)!" -f Green
$FormLibraries | Select Title, DefaultViewUrl, Created | Export-Csv -Path $CSVPath -NoTypeInformation -Append
}
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
}
#Set Variables
$SiteURL = "https://crescent.sharepoint.com/sites/marketing"
$CSVPath = "C:\Temp\FormLibs.csv"
#Connect to PnP Online
Connect-PnPOnline -Url $SiteURL -Interactive
#Get All Webs in the site collection and Iterate through
$Webs = Get-PnPSubWeb -Recurse -IncludeRootWeb
#Delete the Output Report if exists
If (Test-Path $CSVPath) { Remove-Item $CSVPath }
ForEach($Web in $Webs)
{
#Call the function
Get-PnPFormLibraries -Web $Web -CSVPath $CSVPath
}
Bu PowerShell betiği, belirli bir site koleksiyonunda ve tüm alt sitelerinde bulunan InfoPath Form kitaplıklarını tarar ve çıkarır. Kiracının tüm sitelerinde Infopath kitaplıklarını taramak için aşağıdakileri kullanın:
#Parameters
$Domain = "CrescentIntranet" #Your Domain Name in SharePoint Online. E.g. https://Crescent.sharepoint.com
$CSVPath = "C:\Temp\InfoPathRpt.csv"
$Cred = Get-Credential
#Frame Tenant URL and Tenant Admin URL
$TenantURL = "https://$Domain.SharePoint.com"
$TenantAdminURL = "https://$Domain-Admin.SharePoint.com"
#Function to Get Form Libraries
Function Get-PnPFormLibraries
{
[cmdletbinding()]
param(
[parameter(Mandatory = $true, ValueFromPipeline = $False)]$Web,
[parameter(Mandatory = $False, ValueFromPipeline = $False)][String] $CSVPath
)
Try {
Write-host "`tSearching Web '$($Web.URL)'" -f Yellow
#Get All Form libraries
$Lists= Get-PnPProperty -ClientObject $Web -Property Lists
$FormLibraries = $Lists | Where-Object {$_.BaseTemplate -eq 115 -and $_.Hidden -eq $false}
#Export Form Libraries Inventory to CSV
If($FormLibraries.count -gt 0)
{
Write-host "`tFound '$($FormLibraries.count)' Form Librarie(s)!" -f Green
$FormLibraries | Select Title, DefaultViewUrl, Created | Export-Csv -Path $CSVPath -NoTypeInformation -Append
}
}
catch {
write-host "Error: $($_.Exception.Message)" -foregroundcolor Red
}
}
#Connect to Admin Center
Connect-PnPOnline -Url $TenantAdminURL -Credentials $Cred
#Get All Site collections - Exclude BOT, Video Portals and MySites
$Sites = Get-PnPTenantSite -Filter "Url -like $TenantURL -and Url -notlike '-my.sharepoint.com/' -and Url -notlike '/portals/'"
#Iterate through all site collections
$Sites | ForEach-Object {
#Connect to each site collection
Connect-PnPOnline -Url $_.URL -Credentials $Cred
Write-host "`nProcessing Site Collection:"$_.URL -ForegroundColor Magenta
#Get All Webs in the site collection and Iterate through
Get-PnPSubWeb -Recurse -IncludeRootWeb | ForEach-Object {Get-PnPFormLibraries -Web $_ -CSVPath $CSVPath}
}
SharePoint Şirket İçi'ndeki Yol formlarıyla ilgili tüm bilgileri alabileceğiniz başka bir makale: SharePoint'teki Tüm InfoPath Form Kitaplıklarını Bulmak için PowerShell