Set the masterpage using PowerShell in SharePoint
Using Power Shell We can easily change our custom master page in our SharePoint site,once we prepare the script we can use for every time to change the master page.
"Get-SPWeb" i used to get the site URL of the SharePoint in a variable.
We have two Properties to control the master Page settings, CustomMasterUrl and MasterUrl
Using Power Shell We can easily change our custom master page in our SharePoint site,once we prepare the script we can use for every time to change the master page.
"Get-SPWeb" i used to get the site URL of the SharePoint in a variable.
We have two Properties to control the master Page settings, CustomMasterUrl and MasterUrl
Site Master Page --- CustomMasterUrl
System Master Page --- MasterUrl
Example:
$web = Get-SPWeb http://Dotnetsharepoint.com
$web.CustomMasterUrl = "/_catalogs/masterpage/Custom.master"
$web.MasterUrl = "/_catalogs/masterpage/Custom.master"
$web.Update()
No comments:
Post a Comment