Find All InfoPath List Forms in SharePoint using PowerShell

Requirement: Find all customized InfoPath list forms in SharePoint. Tasked to report a listing of all the InfoPath List forms customized in the SharePoint web application during a migration project.

PowerShell Script to Find All InfoPath List Forms in SharePoint

With the deprecation of InfoPath in SharePoint 2016 and Office 365, we wanted to find all the lists customized with InfoPath forms in our SharePoint environment. In this blog post, we will show you how to use PowerShell to find all of the InfoPath list forms in SharePoint site collections.

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

This script generates a CSV output report as below:

infopath list forms report in sharepoint

Related Post: Find all InfoPath Form Libraries in SharePoint

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

10 thoughts on “Find All InfoPath List Forms in SharePoint using PowerShell

  • hi, i ran the script after updating the parameters. i am getting the below error

    Cannot index into a null array.
    At line:16 char:41
    + … s | Where { $_.ContentTypes[0].ResourceFolder.Properties[“_ipfs_infop …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : NullArray

    Reply
  • Can you please help me in writing Power shell script to use for SharePoint Online (in cloud) to get list of all the InfoPath forms used in our SharePoint online site?

    Reply
  • Hi,

    How can we get PowerApps form details instead of Infopath? Thanks

    Reply
  • Is there a way to find all Nintex forms that use custom JavaScript? Perhaps you have a script to share.

    Reply
  • what is the way to get same details for sharepoint online sites

    Reply
  • Is there any way you can do this for InfoPath Form Libraries? I saw your other post to pull InfoPath libraries (https://www.sharepointdiary.com/2012/09/find-all-infopath-form-libraries.html) but it was for SP 2007. Would this work for SP 2016?

    Reply
  • Can you please share steps as how to execute above command

    Reply
    • Just copy the script to any of your SharePoint On-premises Server, change the parameters like $WebAppURL according to your environment and execute it with PowerShell ISE (Safer side!).

      Reply
  • Hi,

    Can you include last modified date on this script?

    Thanks,
    VS

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *