PowerShell Script To Determine If SharePoint List Uses InfoPath Forms

   Recently I had a request from a customer to find which SharePoint 2010 / 2013 lists are using InfoPath forms for their data entry (also known as enterprise forms for a SharePoint list).  In this post I will show you a PowerShell script to determine if a SharePoint list is using InfoPath forms.

 

Problem

  As you may have heard, InfoPath as a product will not be receiving any future releases (see InfoPath roadmap update blog post).  Being able to find SharePoint lists using InfoPath forms may be useful to you now.

 

Solution

   Special thanks goes out to Joe Rodgers (fellow PFE at Microsoft) who helped me narrow down the specific properties to look at.  The property that we want is not at the base of the SPList properties nor on the SPList.Forms properties like I had hoped.  Instead you will need to dig a few levels down.  I found the property at SPList.ContentTypes[0].ResourceFolder.Properties[“_ipfs_infopathenabled”].  If this setting is true then your list is using InfoPath forms for data entry.  If it is false then it is using out of the box SharePoint forms.

 

Add-PSSnapin microsoft.sharepoint.powershell 
$webURL = <Your Site URL> 
$documentLibraryName = <name of document library> 

$web = Get-SPWeb 
$list = $web.Lists[“$documentLibraryName”] 
$isUsingInfoPath = $list.ContentTypes[0].ResourceFolder.Properties[“_ipfs_infopathenabled”] 
Write-Output $isUsingInfoPath 

 

Conclusion

   This script will determine if a single SharePoint list is using InfoPath forms or not.  You could easily expand this to work with multiple lists or sites (similar to my PowerShell Script to Determine Number of Files in SharePoint 2010 or 2013 Document Libraries).  Feel free to adapt the above snippet in this post to your needs but please attribute rights if you republish.

 

      -Frog Out

2 thoughts on “PowerShell Script To Determine If SharePoint List Uses InfoPath Forms

  1. Originally posted on: https://briantjackett.com/archive/2014/04/23/powershell-script-to-determine-if-sharepoint-list-uses-infopath-forms.aspx#638268Thanks much, this got me started. Adding a little from http://consultingblogs.emc.com/robertoortega/archive/2011/10/26/list-all-infopath-forms-for-migration.aspx and then tweaking it I now have…foreach($webapp in Get-SPWebApplication){ foreach($site in $webapp.Sites){ foreach($web in $site.AllWebs){ foreach($list in $web.Lists){ if ($list.BaseType -eq “DocumentLibrary” -and $list.BaseTemplate -eq “XMLForm”){ Write-Host “$($list.Url),InfoPath form library” }elseif ($list.ContentTypes[0].ResourceFolder.Properties[“_ipfs_infopathenabled”]){ Write-Host “$($list.Url),InfoPath enabled list” } } $web.Dispose() } $site.Dispose() }}

    Like

  2. Originally posted on: https://briantjackett.com/archive/2014/04/23/powershell-script-to-determine-if-sharepoint-list-uses-infopath-forms.aspx#646317I was having trouble getting the above script from Steve to get the URL to work, just grabbed the new form URL property. Might be a better way. foreach($webapp in Get-SPWebApplication){ foreach($site in $webapp.Sites){ foreach($web in $site.AllWebs){ foreach($list in $web.Lists){ if ($list.BaseType -eq “DocumentLibrary” -and $list.BaseTemplate -eq “XMLForm”) { $url = $list.DefaultNewFormUrl Write-Host “$list , $url , InfoPath form library” } elseif ($list.ContentTypes[0].ResourceFolder.Properties[“_ipfs_infopathenabled”]) { $url = $list.DefaultNewFormUrl Write-Host “$list , $url , InfoPath enabled list” } } $web.Dispose() } $site.Dispose() }}

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s