2011年9月7日 星期三

使用 PowerShell 變更 SharePoint 的 MasterPage


$customMasterPage="/_catalogs/masterpage/nightandday.master"
$site=get-SpSite "<-Url>"
$web=$site.RootWeb
$masterUri=New-Object System.Uri($web.Url+$customMasterPage)
$web.MasterUrl=$masterUri.AbsolutePath
$web.CustomMasterUrl=$masterUri.AbsolutePath
$web.Update()
$web.Dispose()
$site.Dispose()

沒有留言:

張貼留言