Welcome to deBUG.to Community where you can ask questions and receive answers from Microsoft MVPs and other experts in our community.
1 like 0 dislike
1.2k views
in SharePoint Server by 21 22 32

I have an issue related to my custom system master page and i can't open the SharePoint site settings to change it back to the default master page, so How can I change seeting master page in SharePoint 2019 site using PowerShell?

set master page in SharePoint 2019 using PowerShell


1 Answer

2 like 0 dislike
by 163 204 403
selected by
 
Best answer

How to change System Master Page in SharePoint 2019 using PowerShell

To set the System Master Page in SharePoint 2019 using PowerShell, you can follow these steps:

  1. Open SharePoint Management Shell as Administrator
  2. Run the below PowerShell Script with your site URL

     $SPWeb = Get-SPWeb "http://debug.to/sites/HR/"   #P.S: SiteURL
     #Set the current site master page to the default master page
     $SPWeb.CustomMasterURL = "/sites/HR/_catalogs/masterpage/oslo.master" 
     $SPWeb.Update() 
    
  3. Go back to refresh your site, that should now use the default site master page

If you don’t ask, the answer is always NO!
...