Change Master Page using PowerShell in SharePoint 2013/2016

his PowerShell SharePoint tutorial explains, how to change the master page of a site using PowerShell in SharePoint 2013/2016. Here I will show, how we can set a custom master page as default master page in SharePoint 2013 site.

Change Master Page using PowerShell in SharePoint 2013/2016

SharePoint 2013 has two new default master page:

  • Seattle.master
  • oslo.master

The difference between Seattle.master and oslo.master is that if you use Oslo. master, the top navigation pane is replaced with the left navigation pane, and the sidebar on the left disappears.

Meaning that normally in the left navigation Home, Documents, Recent, Site Contents links usually appear. When you apply Oslo. master these links will appear in the top navigation pane. And there will be no links in the left sidebar.

Here I have developed a custom master page in SharePoint 2013 and I will set that custom master page as the default master page.

Below is the PowerShell command to set master page in SharePoint 2013, which we can run using Windows PowerShell ISE on the SharePoint server.

$web = Get-SPWeb http://win-pfcp2dgt8di/sites/EnjoySharePoint
$web.CustomMasterUrl = “/_catalogs/masterpage/mycustom.master”
$web.MasterUrl = “/_catalogs/masterpage/mycustom.master”
$web.Update()

You may like following SharePoint master page tutorials:

The above PowerShell command will change the master page to mycustom.master. Hope this will be helpful to set master page in SharePoint 2013 using PowerShell.

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

Bijay Kumar

I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SharePointSky.com

  • G says:

    Although you put out good articles, i cuss the first few minutes every time I’m at your site or click on articles within your site. It is due to the overwhelming ridiculous pop ups and adverts!
    Sincerely wish you could rethink the approach!
    Good job – thanks!

    • Bijay Kumar says:

      Hi, Thanks for your feedback. I will surely look at into it. Ads are the only source of income to maintain the web site.
      But I will definitely have a look at it.

  • >