I have used this powershell script to upgrade UI version and apply the master page at root web of a site collection to all subsites
$siteUrl =
"http://<Site URL>"
Start-SPAssignment -Global
$site = Get-SPSite "$siteUrl"
$topWeb = Get-SPWeb $site.Url
$topWeb.CustomMasterUrl =
"/_catalogs/masterpage/My.master"
$topWeb.MasterUrl =
"/_catalogs/masterpage/My.master"
$topWeb.Update()
$site | Get-SPWeb -limit all |
ForEach-Object {$_.UIVersion = 4;$_.UIVersionConfigurationEnabled = 0;if
(($_.WebTemplate -ne "SRCHCEN") -and ($_.WebTemplate -ne
"SRCHCENTERLITE") -and ($_.WebTemplate -ne
"SRCHCENTERFAST")) {$_.CustomMasterUrl =
$topWeb.CustomMasterUrl;$_.AllProperties["__InheritsCustomMasterUrl"]
= "True";$_.MasterUrl =
$topWeb.MasterUrl;$_.AllProperties["__InheritsMasterUrl"] =
"True";$_.AlternateCssUrl =
$topWeb.AlternateCssUrl;$_.AllProperties["__InheritsAlternateCssUrl"]
= "True";$_.Update();}}
Stop-SPAssignment -Global
No comments:
Post a Comment