Skip to content

Instantly share code, notes, and snippets.

@estruyf
Created May 2, 2014 12:30
Show Gist options
  • Save estruyf/cb4e2835f1ba673e0f85 to your computer and use it in GitHub Desktop.
Save estruyf/cb4e2835f1ba673e0f85 to your computer and use it in GitHub Desktop.
$site = Get-SPSite -Identity "http://YourSiteCollectionUrl"
try {
$site | Get-SPWeb -limit all | ForEach-Object {
$_.CustomMasterUrl = $site.RootWeb.CustomMasterUrl
$_.AllProperties["__InheritsCustomMasterUrl"] = "True"
$_.MasterUrl = $site.RootWeb.MasterUrl
$_.AllProperties["__InheritsMasterUrl"] = "True"
$_.AlternateCssUrl = $site.RootWeb.AlternateCssUrl
$_.AllProperties["__InheritsAlternateCssUrl"] = "True"
$_.Update()
}
}
catch [Exception]
{
Write-Host $_.Exception.Message -ForegroundColor red
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment