SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We have over 80 Site Collections in our Web Application is there a way through power shell that i can set the same master page for all the site collections.

share|improve this question
Is the master page and all associated assets already installed in all site collections? – Dave Wise May 22 '12 at 17:19
Yes but as there are some changes going on in master page and we want to have uniqueness for all the site collections and it is very tedious process to go and do the change is each individual site collections master page – Anil May 22 '12 at 17:29
up vote 2 down vote accepted

I don't have a ready-made PowerShell script but these two should get you going. You can enumerate through all site collections in a web application and then apply the master page to each site collection found. The way that the master page is applied is much better than most you will find on the web because it also excludes Search Centers when it recurses through the site.

share|improve this answer

If you have deployed your master page via a feature similar to this one, is all about activating your feature using something similar ( - this has a WebProvisioned event which simply changes master page as soon as the Feature is activated:

Get-SPWebApplication "<WebApplicationURL>" | Get-SPSite -Limit ALL | 
        ForEach-Object {Enable-SPFeature -identity "MyBrandingFeature" -URL $_.URL}

If you have your master page in place, you need to combine the above with

$web = Get-SPWeb http://sharepoint

$web.CustomMasterUrl = "/_catalogs/masterpage/myCool.master"

$web.MasterUrl = "/_catalogs/masterpage/myCool.master"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.