What Can a Global Master Page Do For Me?
Using a global master page can speed up the process of branding your Sharepoint site. Typically each site and page has its own master page. This is fine if you never need to make any changes. Once all your sites have been deployed, a simple favicon change could take hours depending on how many sites and pages you have, and how comfortable you are with PowerShell.
The PowerShell scripts below are a great way to maintain a single master page per site collection.
Get your master page the way you want it and then utilize one of the below scripts.
*Note: Test all scripts and cmdlets in a development environment before using on your production environment.
Set Master Page for Single Site
$web = Get-SPWeb siteurl
$web.MasterUrl = “masterpageurl”
$web.Update()
$web.Dispose()
$web.MasterUrl = “masterpageurl”
$web.Update()
$web.Dispose()
Set Master Page for All Sites in Collection
$site = Get-SPSite http://yoursitehere
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = “/sites/collaboration/_catalogs/masterpage/yourfilehere.master”;$_.Update() }
$site.Dispose()
$site | Get-SPWeb -limit all | ForEach-Object { $_.MasterUrl = “/sites/collaboration/_catalogs/masterpage/yourfilehere.master”;$_.Update() }
$site.Dispose()
Now, if you edit the master page, all sites configured to utilize the new Master Page will be changed.
I would highly recommend you keep a copy of your original v4.master page before modifying and creating your new master page.
No hay comentarios:
Publicar un comentario