List all WebParts in page using Windows Powershell

I published on TechNet Gallery a script to list all WebParts opened in a site collection or a list of site collections.

A couple of days ago I noticed a tweet in the #SPHelp feed that called my attention. Here it is:

I was sure that I already used a Powershell script to do that, but when I found and tried it I noticed that all the resulting rows reported only ErrorWebPartAfter googling for some minutes I fount a blog post of Glyn Clough (this is the url that inspired me (thank you Glyn :)) to create a new script that I just published on TechNet Gallery.

The script loop through a site collection (or a list of site collections) and creates a log file (CSV) listing all the web parts opened in all pages. The script accepts three parameters: URL, folder, WP (otpional).

  1. URL contains the URL of the site collection (or a comma separated list of URLs) where you want to search in;
  2. Folder is where you want to save the report. It must be an existing folder;
  3. WP (optional) is the name (or part of the name) of the web part you want to search for.

Setting the WP parameter the script creates a second log file listing only the web parts corresponding to the search criteria.

You should call the script the following way:

You can download the script from TechNet Gallery here:

– Riccardo


Posted by Riccardo

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.