Today I ran into a problematic sub-site in my SharePoint 2013 farm. This sub-site, named “Test”, was where I had been testing the new branding that would eventually be applied to the entire site. Somehow I managed to apply the same branding to the main page as well as the admin pages and effectively locked myself out of all the lovely admin options.
PowerShell to the rescue! Below is the code used to reset the master page to something more manageable, like the Seattle master page template.
$web = Get-SPWeb http://sharepoint/subsite
$web.CustomMasterUrl = “/_catalogs/masterpage/seattle.master”
$web.MasterUrl = “/_catalogs/masterpage/seattle.master”
$web.Update()
Enjoy!
SS