Hello,
I am trying to determine a way to parse through all Site Collections and sub-sites in SharePoint Online and find if there are any InfoPath forms present, and if so, if they are in use or not.
Thanks!
Joe
Hi Joe,
I don’t have anything available readily for Online. But I would suggest you to check a PnP sample code here.
https://sharepoint.stackexchange.com/questions/240149/get-the-list-of-all-available-infopath-forms-in-a-sharepoint-site-collection-s
Hi Chanakya,
Just wanted to see if you’d maybe have something to work with SharePoint Online? I’ve been trying with the script found here, but I cannot get it to search the root site collections. It always goes 1 sub-site deep and beyond, but will not search the root of the site collection. We have over 2,700 site collections.
Thanks,
Joe
Hello Joe
Check if below code helps you.
[apcode language=”powershell”]
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") > $null #Get the web application Write-Host "Enter the Web Application URL:" $WebAppURL= Read-Host $SiteColletion = Get-SPSite($WebAppURL) $WebApp = $SiteColletion.WebApplication #Write the CSV header "Site Collection `t Site `t List Name `t List Url `t Docs Count `t Last Modified `t Form Template" > InfoPathLibs.csv #Loop through all site collections of the web app foreach ($site in $WebApp.Sites) { # get the collection of webs foreach($web in $site.AllWebs) { write-host "Scanning Site" $web.title "@" $web.URL foreach($list in $web.lists) { if( $list.BaseType -eq "DocumentLibrary" -and $list.BaseTemplate -eq "XMLForm") { $listModDate = $list.LastItemModifiedDate.ToShortDateString() $listTemplate = $list.ServerRelativeDocumentTemplateUrl #Write data to CSV File $site.RootWeb.Title +"`t" + $web.Title +"`t" + $list.title +"`t" + $Web.Url + "/" + $List.RootFolder.Url +"`t" + $list.ItemCount +"`t" + $listModDate +"`t" + $listTemplate >> InfoPathLibs.csv } elseif ($list.ContentTypes[0].ResourceFolder.Properties["_ipfs_infopathenabled"]) { $listModDate = $list.LastItemModifiedDate.ToShortDateString() $listTemplate = $list.ServerRelativeDocumentTemplateUrl #Write data to CSV File $site.RootWeb.Title +"`t" + $web.Title +"`t" + $list.title +"`t" + $Web.Url + "/" + $List.RootFolder.Url +"`t" + $list.ItemCount +"`t" + $listModDate +"`t" + $listTemplate >> InfoPathDetails.csv } } } } #Dispose of the site object $siteColletion.Dispose()
[/apcode]
Hi Chanakya,
Just wanted to see if you’d maybe have something to work with SharePoint Online? I’ve been trying with the script found here, but I cannot get it to search the root site collections. It always goes 1 sub-site deep and beyond, but will not search the root of the site collection. We have over 2,700 site collections.
Thanks,
Joe
Hi Chanakya,
It appears this would be for more of an On-Prem install, correct? I am looking for one for SharePoint Online.
Thanks,
Joe