SharePoint Online: Working With List Settings Using PowerShell

In this article we will discuss the configuration of some of the important List Settings for SharePoint Online Lists. Though I have taken only a handful of operations to showcase in this demo, but remember there are lot more to explore.

Operation: How to enable “New Folder” Menu Command

We can see this setting available under “Advanced Settings” for the list as shown below-

1

We can play with this setting using PowerShell as described below-

2

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “EnableFolderCreation” to True

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

3

Once this script executes successfully we can see list setting updated by navigating “Advanced Settings” of the list as shown below-

4

Operation: How to disable “List Item Attachments” Option

We can see this setting available under “Advanced Settings” for the list as shown below-

5

We can play with this setting using PowerShell as described below-

6

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “EnableAttachments” to False

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

7

Once this script executes successfully we can see list setting updated by navigating “Advanced Settings” of the list as shown below-

8

Operation: How to enable “Quick Launch” Option for List

We can see this setting available under “General Settings” for the list as shown below-

9

We can play with this setting using PowerShell as described below-

10

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “OnQuickLaunch” to True

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

11

Once this script executes successfully we can see list setting updated by navigating “General Settings” of the list as shown below-

12

Operation: How to enable “Version History” for List Item Attachments

We can see this setting available under “Versioning Settings” for the list as shown below-

13

We can play with this setting using PowerShell as described below-

14

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “EnableVersioning” to True

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

15

Once this script executes successfully we can see list setting updated by navigating “Versioning Settings” of the list as shown below-

16

We may work on additional version settings as well as shown below-

17

For example let try to enable Minor Versions for a document library “ProductDesigns” by using PowerShell

18

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “EnableMinorVersions” to True

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

19

Once this script executes successfully we can see list setting updated by navigating “Versioning Settings” of the list as shown below-

20

Operation: How to enable “Require Check Out” Option

We can see this setting available under “Versioning Settings” for the list as shown below-

21

We can play with this setting using PowerShell as described below-

22

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “ForceCheckOut” to True

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

23

Once this script executes successfully we can see list setting updated by navigating “Versioning Settings” of the list as shown below-

24

Operation: How to enable “Require Content Approval” Option

We can see this setting available under “Versioning Settings” for the list as shown below-

25

We can play with this setting using PowerShell as described below-

26

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “EnableModeration” to True

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

27

Once this script executes successfully we can see list setting updated by navigating “Versioning Settings” of the list as shown below-

28

Operation: How to configure “Draft Item Security” Option

We can see this setting available under “Versioning Settings” for the list as shown below-

29

We can play with this setting using PowerShell as described below-

30

In Step 1 we will get the object reference to the respective list by calling “GetByTitle” method

In Step 2 we will set “DraftVersionVisibility” to “Approver”. This setting will limit access to the draft items for the Approvers only.

In Step 3 we will update the list property by calling “Update” method

In Step 4 we will send the batch request to SharePoint Server for processing by calling “ExecuteQuery” method

In Step 5 we will display success message to the Users if Step 4 executes successfully

In Step 6 we will call function that we have explained in Step 1-5

31

Once this script executes successfully we can see list setting updated by navigating “Versioning Settings” of the list as shown below-

32

That is all for this demo.

Hope you find it helpful.

Leave a comment