Home Contact

The Frog Pond of Technology

Ripples of Knowledge for SharePoint and Other .Net Technologies

News

My blog has moved to WordPress at BrianTJackett.com. Any pages will automatically redirect to the new address in 7 seconds. Please excuse an issues during this migration.

 Subscribe to this blog


About Me

Name:
Brian T. Jackett
Location:
Columbus, OH
Company:
Microsoft

Find me on...

Tag Cloud


Archives

Post Categories

Syndication:

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.

 

001
002
003
004
005
006
007
008

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


Wednesday, April 23, 2014 4:18 PM

Feedback

# re: PowerShell Script To Determine If SharePoint List Uses InfoPath Forms

Thanks 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()
}
}
6/9/2014 9:20 PM | SteveC

# re: PowerShell Script To Determine If SharePoint List Uses InfoPath Forms

I 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()
}

} 9/22/2015 11:25 PM | Eric Schrader

Post A Comment
Title:
Name:
Email:
Comment:
Verification: