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:
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.
$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:
- Convert an HTML page into a SharePoint master page using Design manager
- Create a custom master page using Visual Studio in SharePoint 2016/2013
- Only Content controls are allowed directly in a content page that contains Content controls SharePoint 2013 Page Layout
- How to Change Layout of a Page in SharePoint 2013
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.
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 SPGuides.com