Q: Can I set my newly created custom page in my SharePoint site as the home page?
Use PowerShell to set a custom SharePoint page as a home page.
November 26, 2012
![Q: Can I set my newly created custom page in my SharePoint site as the home page? Q: Can I set my newly created custom page in my SharePoint site as the home page?](https://eu-images.contentstack.com/v3/assets/blt07f68461ccd75245/blt98685bab1631c888/661cf480e055c6c0c6f1bb30/data-595x335_0_3.jpg?width=1280&auto=webp&quality=95&format=jpg&disable=upscale)
A: Yes, it's possible to use a custom page as a home page. You can set it in multiple ways:
If you have enabled the Publishing features on your site, or your site was created from a Publishing template, then you can just go to Site Actions, Site Settings and click Welcome Page, then select a page.
You can open the site in SharePoint Designer, right-click any .ASPX page, and select Set as Home Page.
If you're a developer, you can set the home page by using code. See the MSDN page "SPFolder.WelcomePage property" for more information.
If you're a SharePoint administrator, you can use a Windows PowerShell script to select a master page:
$site = Get-SPSite http://yourserver/sites/yoursite$web = $site.RootWeb (or $web = $site.OpenWeb("yoursubsite")$folder = $web.RootFolder$folder.WelcomePage = "SitePages/home.aspx" (or $folder.WelcomePage = "default.aspx") (or $folder.WelcomePage = "Shared%20Documents/mycustomwebpartpage.aspx")$folder.update()$web.Dispose()$site.Dispose()
For SharePoint 2007, replace the first line of the above script with the following:
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")$site = New-Object Microsoft.SharePoint.SPSite("http://yourserver/sites/yoursite")
About the Author
You May Also Like