Friday 9 December 2016

Get list of Master Pages in Current Farm or in selected Site/Site Collection

Today I am providing the Power Shell Script that is useful to find out all the used master pages(custom/outofbox) in complete (selected site/farm) as per user input.

Inputs
Path - Enter the file name with path to save the report (Enter file name with csv extension)
Other inputs - Script will ask different input on the basis of user choice. Please follow the instructions

Outputs
A CSV file will be generated with the URL of sites and the master pages used in the site.

Example-
.\scriptname.ps1
.\scriptname.ps1 | out-file “FilePath\Filename.txt”

Dependencies –
Run this script with Farm Account. Farm account is the user who installed SharePoint.
User should be Site collection administrator in all the sites.
User should have Shell Admin rights to run the scripts.
Run Management Shell as an Administrator. 
How to execute -
Copy this script and paste in Note pad.
Save this file as .ps1.
Run this script in SharePoint Management Shell. You can run this script in PowerShell as well after adding SharePoint snapin (Add-pssnapin *.sharepoint.*).
Follow on screen instructions.

FOR ANY HELP ON THIS SCRIPT USE "GET-HELP .\SCRIPTNAME.PS1 --FULL" AFTER SAVING THIS FILE.

No comments:

Post a Comment