Using PowerShell to get a list of InfoPath Forms

I would like to have an easy way to get a list of InfoPath forms on SharePoint servers. I know that there is a way to do this with ShareGate’s tool. However, I found a blog posting that described a PowerShell solution:

I ran the PowerShell script in Windows PowerShell ISE on my SharePoint server as an Administrator. I added the following line at the top of the script:


This command loads the SharePoint Windows PowerShell snap-in.

I ran the script and entered the location of the SharePoint site that I wanted to scan: http://server2012sp/sites/testsites

The script scanned the site and provided the following details in the Console Pane:

Scanning Site Root Team Site @ http://server2012sp
Scanning Site RedirectorTest @ http://server2012sp/sites/Redirector
Scanning Site Search Center @ http://server2012sp/sites/SearchCenter
Scanning Site Social Site @ http://server2012sp/sites/social
Scanning Site FirstWiki @ http://server2012sp/sites/social/16f5ab30-c94a-405b-9cb2-371d6a84ff5d
Scanning Site J Wiki 1 @ http://server2012sp/sites/social/39762677-e5c7-4e9b-adde-82f8efdb1fe8
Scanning Site Blue Test Community @ http://server2012sp/sites/social/507346f5-e0f2-424a-9721-1b240420c7c1
Scanning Site Blue Test Community @ http://server2012sp/sites/social/507346f5-e0f2-424a-9721-1b240420c7c1/507346f5-e0f2-424a-9721-1b240420c7c1
Scanning Site Red Test Community @ http://server2012sp/sites/social/72913b70-1f28-474f-ab3d-f255690d2a60
Scanning Site Test Newburyport Community @ http://server2012sp/sites/social/7fc754f1-8c56-4c7f-a0bb-899be93ed74f
Scanning Site Alpha Community @ http://server2012sp/sites/social/91baf58c-fd59-4170-a838-e2d4ab96fc11
Scanning Site Red Community @ http://server2012sp/sites/social/9cfef5da-2139-4128-9bf8-754953765860
Scanning Site My Help Wiki @ http://server2012sp/sites/social/a123ff96-f62c-4a67-87e1-0c74b7a4d75f
Scanning Site The Red Wiki @ http://server2012sp/sites/social/b22340fe-3782-4f4a-96ee-fc7f932b6dde
Scanning Site The Blue Community @ http://server2012sp/sites/social/b79baa8b-252c-44d5-a596-52aec53074a3
Scanning Site FirstBlog @ http://server2012sp/sites/social/FirstBlog
Scanning Site This is my happy blog @ http://server2012sp/sites/social/Happy
Scanning Site Partner Management Blog @ http://server2012sp/sites/social/PartnerManagement
Scanning Site Test Newburyport Community @ http://server2012sp/sites/social/W7aabe4fef1c8_4247_9189_89caeb8d1aa7
Scanning Site Testing @ http://server2012sp/sites/testing
Scanning Site Test Site @ http://server2012sp/sites/testsites
Scanning Site Migration Test @ http://server2012sp/sites/testsites/MigrationTest
Scanning Site Enterprise Wiki Subsite @ http://server2012sp/sites/testsites/wiki
Report Generated at same path of the powershell script InfoPathLibs.csv

The PowerShell script also saved details to a CSV file. I opened the CSV file in Excel to view the saved details. You can see the details below. You may need to use the scroll bar to see all of the content to the right. Note that empty entries in the Form Template column refer to a custom list. Saved Form Template values are document libraries.

Site Collection Site List Name List Url Docs Count Last Modified Form Template
Testing Testing InfoPathTest http://server2012sp/sites/testing/InfoPathTest



Testing Testing Nintex Form Test http://server2012sp/sites/testing/Lists/Nintex Form Test



Test Site Test Site Absence Request http://server2012sp/sites/testsites/Lists/Absence Request



Test Site Test Site All Fields Test http://server2012sp/sites/testsites/Lists/All Fields Test



Test Site Test Site Controls with Rules Test http://server2012sp/sites/testsites/Lists/Controls with Rules Test



Test Site Test Site Generic Custom List for Nintex Form Testing http://server2012sp/sites/testsites/Lists/Generic Custom List for Nintex Form Testing



Test Site Test Site InfoPath Radio Buttons http://server2012sp/sites/testsites/Lists/InfoPath Radio Buttons



Test Site Test Site InfoPathTest http://server2012sp/sites/testsites/InfoPathTest



Test Site Test Site Office Relocation http://server2012sp/sites/testsites/Lists/Nintex Form Testing



Test Site Test Site Project Management Forms http://server2012sp/sites/testsites/Project Management Forms



/sites/testsites/Project Management Forms/Forms/template.xsn
Test Site Test Site Radio Buttons http://server2012sp/sites/testsites/Lists/Radio Buttons



Test Site Test Site Test Form with Drop Down Lists http://server2012sp/sites/testsites/Lists/Test Form with Drop Down Lists



Test Site Test Site Three View InfoPath Form http://server2012sp/sites/testsites/Lists/Three View InfoPath Form



Test Site Test Site Travel Request Library http://server2012sp/sites/testsites/Travel Request Library



/sites/testsites/Travel Request Library/Forms/template.xsn
Test Site Migration Test InfoPathTest http://server2012sp/sites/testsites/MigrationTest/Lists/InfoPathTest



Now I can see which lists have InfoPath forms! However, I know that some of these lists are using a Nintex form by default. The InfoPath form was not removed when the switch to using an InfoPath form was made.

I’m curious if ShareGate can provide a better report. Perhaps it can tell me which form is being used by default in the list?

Aug. 24, 2018: Unfortunately, ShareGate does not have the capability to report on InfoPath forms. However, we can vote to add InfoPath filters in ShareGate reporting. Click here to vote.

Leave a Reply

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

You are commenting using your 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 )

Connecting to %s