Thursday, March 16, 2017

SharePoint: How to change the default home page

$site = Get-SPSite http://peakfinder/sites/site
$web = $site.RootWeb
  (or $web = $site.OpenWeb("site")
$folder = $web.RootFolder
$folder.WelcomePage = "SitePages/home.aspx"
  (or  $folder.WelcomePage = "default.aspx")
  (or  $folder.WelcomePage = "SiteAssets/myhome.aspx")
$folder.update()
$web.Dispose()
$site.Dispose()

No comments:

Post a Comment