List all WebParts in page using Windows Powershell

List all WebParts in page using Windows Powershell

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 http://www.glynblogs.com/2011/07/listing-all-web-parts-in-a-site-collection-with-powershell.html) 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

 

Submit a Comment