When exporting and importing sites throughout SharePoint 2010
that are upgraded sites from SharePoint 2007, you probably noticed that
the homepage for the imported site is defaulted to SharePoint 2010′s
wiki-style page at /SitePages/Home.aspx. However, until you start using
these new pages you may want to revert or keep the homepage as the
default.aspx page. To do this manually, you need to go to Site Actions
> Site Settings > Look and Feel > Welcome Page. However, this
Welcome Page link is only available for those sites where the Publishing
feature is activated at the Site Collection and Site level.

This could be pretty tedious if you have to do this for every site in the web application. So, if you need to do this fast for multiple sites and don’t have direct access to the Welcome Page link, what do you do? You use PowerShell!
Below is a script I created that will prompt to enter in the Web Application and Welcome Page and then loop through each site in the Web Application and set the Welcome Page. Save this as a .ps1 file and run it from the SharePoint 2010 Management Shell:
Now, navigate back to a site and see that the homepage is now set to the given page!
This could be pretty tedious if you have to do this for every site in the web application. So, if you need to do this fast for multiple sites and don’t have direct access to the Welcome Page link, what do you do?
Below is a script I created that will prompt to enter in the Web Application and Welcome Page and then loop through each site in the Web Application and set the Welcome Page. Save this as a .ps1 file and run it from the SharePoint 2010 Management Shell:
$webapp = Read-Host "Enter Web Application" $welcomepage = Read-Host "Enter Welcome Page" $webs = Get -SPSite -WebApplication $webapp -Limit All | Get -SPWeb -Limit All foreach ( $web in $webs ){ $rootFolder = $web .RootFolder $rootFolder .WelcomePage = $welcomepage Write-Host "Setting" $web .Title "homepage to" $welcomepage $rootFolder .Update() $web .Dispose() } |
Nice post. Here is one more post explains the same..
ReplyDeletehttp://sureshpydi.blogspot.in/2014/03/change-default-homewelcome-page-in.html
Thanks for this piece of information. I have just signed up for a free SharePoint site with http://www.cloudappsportal.com.
ReplyDelete