Set default home page using powershell script

Set default master page using the below script

#Author: Prem Kumar
#Date: Feb 11 2015
param(

[string]$InputedURL = $(Read-Host -prompt "Enter Web Application Root URL")
)


try
{
   
    $sourceWeb = Get-SPWeb  $InputedURL
    $oFolder = $sourceWeb.RootFolder;
    $oFolder.WelcomePage = "Pages/Home.aspx";
    $oFolder.Update();
    write-host "Home Page set..,";

}
catch 
{
    write-host "Error in Setting Home Page - $_.Exception.Message"

}
finally
{
    $sourceWeb.Dispose()
}


Comments

  1. After going through your contents I realize that this is the best of my knowledge as it provides the best information and suggestions. This is very helpful and share worthy. If you are looking for the best Mulesoft then visit Neebal. Keep sharing more.

    ReplyDelete
  2. I found your blog on Google and read a few of your other posts. I just added you to my Google News Reader. You can also visit Automation Consulting Services for more Webuters Technologies Pvt. Ltd. related information and knowledge, Keep up the great work Look forward to reading more from you in the future.

    ReplyDelete

Post a Comment

Popular posts from this blog

How to copy SharePoint list workflow

INFOPATH FORM HIDE/DISABLE FIELDS BASED ON SHAREPOINT GROUP MEMBERSHIP

Create multiple columns inside SharePoint List using Powershell