{"id":1463,"date":"2013-12-24T05:28:28","date_gmt":"2013-12-24T05:28:28","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1463"},"modified":"2024-04-26T12:42:48","modified_gmt":"2024-04-26T12:42:48","slug":"updating-master-pages-across-sharepoint-site-collections","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/updating-master-pages-across-sharepoint-site-collections\/","title":{"rendered":"Updating Master Pages across SharePoint Site Collections"},"content":{"rendered":"<h2>Updating Master Pages across SharePoint Site Collections in your farm<\/h2>\n<p>You can use PowerShell to change the Master Page across site collections and across webs:<\/p>\n<pre lang=\"php\">\r\n$Site = get-spsite \u201cht tp:\/\/SharePoint\/Sites\/SpecificSite\u201d\r\n$webcount = $Site.AllWebs.Count\r\n$webs=$Site.AllWebs\r\nfor ($i=0; $i -lt $webcount; $i++)\r\n{\r\n $web=$webs[$i]\r\n $Master=$web.get_MasterUrl()\r\n $Master=$Master.Replace(\"your-custom-master\", \"v4.master\")\r\n $web.set_Masterurl($Master)\r\n $web.update()\r\n $web.dispose()\r\n}\r\n<\/pre>\n<p>Make sure the Publishing feature is activated first:<\/p>\n<pre lang=\"php\">\t\r\nEnable-SPFeature -Identity PublishingWeb -url $web.url\r\n<\/pre>\n<pre lang=\"php\">\r\n$wa=get-spwebapplication ht tp:\/\/webApp\r\nforeach ($Site in $wa.sites)\r\n{\r\nif ($site.url -like $MatchStr)\r\n{\r\n$webcount = $Site.AllWebs.Count\r\n$webs=$Site.AllWebs\r\n        for ($i=0; $i -lt $webcount; $i++)\r\n{\r\n$web=$webs[$i]\r\n$Master=$web.get_MasterUrl()\r\n$Master=$Master.Replace(\"v4.master\",\"my-custom.master\")\r\n$web.set_Masterurl($Master)\r\n$web.update()\r\n$web.dispose()\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Updating Master Pages across SharePoint Site Collections in your farm You can use PowerShell to change the Master Page across site collections and across webs: $Site = get-spsite \u201cht tp:\/\/SharePoint\/Sites\/SpecificSite\u201d $webcount = $Site.AllWebs.Count $webs=$Site.AllWebs for ($i=0; $i -lt $webcount; $i++) { $web=$webs[$i] $Master=$web.get_MasterUrl() $Master=$Master.Replace(&#8220;your-custom-master&#8221;, &#8220;v4.master&#8221;) $web.set_Masterurl($Master) $web.update() $web.dispose() } Make sure the Publishing feature is [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":1466,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1463","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1463","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1463"}],"version-history":[{"count":5,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1463\/revisions"}],"predecessor-version":[{"id":1477,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1463\/revisions\/1477"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1466"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1463"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1463"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1463"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}