SharePoint PowerShell 修改母版页

  前言web

  最近在群里帮忙回答问题,碰到这么一个尴尬的问题,有人建立了一个新母版页,而后引用了新的母版页,不知道怎么的母版页有问题了,再也进不去站点了,但愿修改回旧的母版页。运维

  看到问题,想了一下,其实两种方法能够解决,一个是用SharePoint Designer打开站点,找到旧的母版页,直接设置就好了(前提是Designer还能打开);工具

  第二种方法就是用PowerShell命令来解决了,命令以下:spa

$web = Get-SPWeb http://sharepoint
$web.CustomMasterUrl = "/_catalogs/masterpage/nightandday.master"
$web.MasterUrl = "/_catalogs/masterpage/nightandday.master"
$web.Update()

  结束语code

  其实,SharePoint PowerShell在开发和运维中,有着很是棒的帮助,你们必定不要忘记这一工具。blog

相关文章
相关标签/搜索