{"id":1723,"date":"2013-05-21T10:49:22","date_gmt":"2013-05-21T10:49:22","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1723"},"modified":"2024-04-26T12:51:59","modified_gmt":"2024-04-26T12:51:59","slug":"how-to-recover-from-a-malfunctioning-sharepoint-master-page","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/how-to-recover-from-a-malfunctioning-sharepoint-master-page\/","title":{"rendered":"How to recover from a malfunctioning SharePoint Master Page"},"content":{"rendered":"<h2>Recover from a broken Master Page<\/h2>\n<p>Last night I had a bit of fun trying to fix a bad Master Page that prevented access to anything in a site collection via the browser. This Master Page had a reference to a SharePoint Feature that had since been retracted and removed. The solution was to use PowerShell to change the Master Page:<\/p>\n<pre lang=\"php\">\r\n$Site = get-spsite \u201chttp :\/\/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","protected":false},"excerpt":{"rendered":"<p>Recover from a broken Master Page Last night I had a bit of fun trying to fix a bad Master Page that prevented access to anything in a site collection via the browser. This Master Page had a reference to a SharePoint Feature that had since been retracted and removed. The solution was to use [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":1724,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1723","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\/1723","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=1723"}],"version-history":[{"count":1,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1723\/revisions"}],"predecessor-version":[{"id":1725,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1723\/revisions\/1725"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1724"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1723"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1723"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1723"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}