none
List - change some default list settings using CSOM Powershell

    Question

  • Hello! Pretty new to this powershell stuff and CSOM I am trying to make some changes to the default settings under list settings, such as classification YES and use Stars. We want to push out these settings - among others - in a powershell script for list creation. Is it a list property maybe? Could not find anything on tehcnet - looking here: https://msdn.microsoft.com/en-us/library/office/microsoft.sharepoint.client.list_members.aspx.

    Maybe it is unreachable using csom through powershell? Colleague of mine is working on an app, maybe we can get to were we want from there? Did not look like it though...

    Help appreciated.

    Time to learn powershell anyway....

    Thanks!


    Tuesday, April 12, 2016 12:43 PM

Answers

  • Anyhow...I later found out that these settings were "part of" an webnavigations class which did not expose these properties on SP Online. 
    • Marked as answer by CK2214 Wednesday, April 13, 2016 9:44 AM
    Tuesday, April 12, 2016 7:53 PM

All replies

  • The best approach if you want to use PowerShell / CSOM is to use Get-Member command..

    For example after creating your context you can use following code to get list.

        

    $web = $ctx.Web 

        $list = $web.Lists.GetByTitle("Documents")

        $ctx.Load($web) 

        $ctx.Load($list)

        $ctx.ExecuteQuery()

    Once you have this then simply type $list | Get-Member on your PowerShell window

    This will give you all the methods and properties available for your $list object. 

    Remember Get-Member is your friend for anything PowerShell. :)

    I would highly recommend using the following article if you have not started with PowerShell + CSOM.

    http://www.sharepointnutsandbolts.com/2013/12/Using-CSOM-in-PowerShell-scripts-with-Office365.html

    Tuesday, April 12, 2016 1:07 PM
    Moderator
  • Thanks. I forgot about the get-member cmdlet. I'll try that!
    Tuesday, April 12, 2016 5:20 PM
  • Anyhow...I later found out that these settings were "part of" an webnavigations class which did not expose these properties on SP Online. 
    • Marked as answer by CK2214 Wednesday, April 13, 2016 9:44 AM
    Tuesday, April 12, 2016 7:53 PM