Search This Blog

Tuesday, August 27, 2013

How to change the master page of a SharePoint 2010 team site?

A specific site -

$web = Get-SPWeb http://hostname/sites/test
$web.MasterUrl = "/sites/collaboration/_catalogs/masterpage/v4_custom.master
$web.Update()
$web.Dispose()


An entire site collection -

$site = Get-SPSite http://hostname/sites/test
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = "/sites/collaboration/_catalogs/masterpage/v4_custom.master";$_.Update() }
$site.Dispose()

Things to remember:

In the above examples, v4_master represents your custom master page, change accordingly.
In the above examples, http://hostname/sites/test represents your site's URL, change accordingly.
These commands will need to be run each time a new site is created.

No comments:

Post a Comment