enter image description hereI am try to set document set welcome page view with powershell csom with out any luck. Does anyone have an idea how to do it

Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\15\ISAPI\Microsoft.SharePoint.Client.Runtime.dll"
Import-Module Sharegate

$siteUrl = "https://sharepoint.com/sites/projects/"

write-host "Connecting to SharePoint "$siteUrl
$pwd =  convertto-securestring $password -asplaintext -force
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl) 
$credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $pwd)
$ctx.Credentials = $credentials

write-host $web.title
$list = $web.Lists.GetByTitle("Documents")

 Foreach($ct in $contentypee){
  if($ct.name -eq 'Record'){
     Write-Host  "list title"  $list.title
     Write-Host  "contenttype name is "  $ctrecord.Name
     Write-Host  "content type id "  $ctrecord.ID
  • do you get an error?
    – ova
    Aug 23, 2016 at 8:56
  • No error, but I can't go further ,don't find any cmdlet like Setwelcomepage or something
    – Waqas
    Aug 23, 2016 at 9:03

3 Answers 3


Here is technet answer I found of someone trying to achieve the same thing.

In case the link ever goes down, here is the answer in question:

You can certainly do this with PowerShell! You need to dive into the object model a little bit to accomplish this. Please keep in mind that the Welcome page is a relative link to your site.

Say your current site collection welcome page is http://yoursitecollection/Pages/Home.aspx and you want to change it to http://yoursitecollection/Pages/NewWelcomePage.aspx.

$assignment = Start-SPAssignment

$web = Get-SPWeb -Identity "http://yoursitecollectionurl" AssignmentCollection $assignment

$rootFolder = $web.RootFolder

$rootFolder.WelcomePage = "Pages/NewWelcomePage.aspx"


Stop-SPAssignment $assignment

Another note - if there are spaces in your .aspx page file name, then simply type spaces (i.e. you don't need to include the url encoded %20 for spaces). For example you could change the line above to:

$rootFolder.WelcomePage = "Pages/New Welcome Page.aspx"

I hope this helps,


  • Thanks but i am looking for Document-set welcome page view
    – Waqas
    Aug 23, 2016 at 9:28
  • Apologies, I misread your post in my haste. Could the above work if you changed the context of $rootfolder to that of your document set?
    – Ray Hogan
    Aug 23, 2016 at 9:37
  • My knowlage is limmited but i dont thing document-set has rootfolder property
    – Waqas
    Aug 23, 2016 at 10:42

Try the following:

  • Get welcome page from document set
  • Get webpart manager from welcome page
  • Get the document list Webpart
  • Set the view on the Webpart

No idea, how you can change the default on the document set configuration


that is only doable in sharepoint on premises, here is an explanation for programmatically setting up the document set default view on a list

=> If you want a workaround for sharepoint online, please use this powershell docset welcomepage view setter and follow this example

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.