Archive

Archive for July, 2015

PowerShell: Apply Master Page and Logo to Team Sites

July 7, 2015 Leave a comment

Apply custom master page and Logo to site and all its subsites where site is Team Site

Add-PSSnapin Microsoft.SharePoint.PowerShell –ErrorAction SilentlyContinue
$site = Get-SPSite yoursitecollectionurl
foreach ($web in $site.AllWebs)
{
 $web.MasterUrl = $site.RootWeb.ServerRelativeUrl + "/pathtoyourmasterpage.master";
 $web.CustomMasterUrl = $site.RootWeb.ServerRelativeUrl + "/pathtoyourmasterpage.master";
 $web.SiteLogoUrl = $site.RootWeb.ServerRelativeUrl + "/pathtoyourlogo.gif";
 $web.Update();
 Write-Host $web.Url $web.MasterUrl $web.CustomMasterUrl;
}
write-host "completed"

Happy SharePointing !