Set-SPListSettings PowerShell Cmdlet

Introduction

 A custom powershell cmdlet which is used to modify or set the SharePoint 2010 list settings. Values can be set/modify for list General Settings, Versioning Settings and Advanced Settings.


Set-SPListSettings

Custom Powershell cmdlet to modify or set the SharePoint list settings.

Set-SPListSettings [-url] <String> [-ListName] <String> [[-Title] <String>] [[-Description] <String>] [[-OnQuickLaunch] <String>] [[-EnableModeration] <String>] [[-EnableVersioning] <String>] [[-EnableMinorVersions] <String>] [[-MajorWithMinorVersionsLimit] <Int32>] [[-MajorVersionLimit] <Int32>] [[-DraftType] <Int32>] [[-ForceCheckout] <String>] [[-ContentTypesEnabled] <String>] [[-ItemOpen] <Int32>] [[-EnableFolderCreation] <String>] [[-NoCrawl] <String>] [[-ExcludeFromOfflineClient] <String>] [[-IsSiteAssetsLibrary] <String>] [[-DisableGridEditing] <String>] [[-EnableAttachments] <String>] [[-NavigateForFormsPages] <String>]



Parameters

Parameter Required Type Description

Url Required System.String . Specifies the URL of the site collection.

ListName . Required System.String Specifies the list name.

Title Optional System.String Sets the title for the list.

Description Optional System.String Sets the description for the list.

OnQuickLaunch . Optional System.String Sets the value whether the list appears on the Quick Launch area of the home page. Valid values are true or false.

EnableModeration . Optional System.String Sets whether new items or changes to existing items should remain in a draft state until they have been approved.Valid values are true or

false

EnableVersioning . Required System.String Sets whether a version is created. Valid values are true or false.

EnableMinor . Optional System.String . Sets the minor version. Valid values are

Versions true or false.

MajorWithMinor Optional System.String . Sets MajorWithMinor Versions Limit. VersionsLimit Values 1-5000


MajorVersionLimit Optional . Sets Major

Version limit.

Values 1-5000

DraftType Optional Sets which users

should be able

to view drafts

in this document

library. Value=0,

Reader Value=1,

Author.Value=2,

Approver.

ForceCheckout . Optional System.String Sets whether users must check out documents before making changes in this document library. Valid values are true or false.

ContentTypesEnabled . Optional System.String Sets whether to allow the management of content types on this document library. Valid values are true or false.

ItemOpen Optional . Sets whether browser

-enabled documents

should be opened

in the client or browser

by default when a

user clicks on them.

If the client application

is unavailable, the

document will always

be opened in the browser.

Value=1, Open in t

he client application

Value=2, Open in

the browserValue=3,

Use the server default

(Open in the browser)

EnableFolderCreation Optional System.String Sets whether the "New Folder" command is available. Changing this setting does not affect existing folders. Valid values are true or false.

NoCrawl Optional System.String Sets whether this document library should be visible in search results. Valid values are

true or false.

ExcludeFromOffline Optional . System.String Sets whether this document library should Client be available for offline clients. Valid values

are true or false.

IsSiteAssetsLibrary Optional . System.String Sets whether this library should be presented as the default location for storing images or other files that users upload to their wiki pages. Valid values are true or false.

DisableGridEditing Optional . System.String . Sets whether the datasheet can be used to bulk edit data on this document library. Valid values are true or false.

NavigateForForms Optional System.String Sets whether to launch the new, edit, and Pages display forms in a dialog. Valid values are

true or false.

EnableAttachments Optional System.String Sets whether users can attach files to items in this list. Valid values are true or false.

Detailed Description

The Set-SPListSettings cmdlet sets the value for the list Title, Description and OnQuickLaunch.


EXAMPLE 1

Set-SPListSettings http://sitename/sites/test -ListName "Shared Documents" –Title "Doc Library Updated"

This example modifies the list title.



EXAMPLE 2

Set-SPListSettings http://sitename/sites/test -ListName "Shared Documents" –Description "My Updated Doc Library"

This example sets the value for the description.


EXAMPLE 3

Set-SPListSettings http://sitename/sites/test -ListName "Shared Documents" –OnQuickLaunch false

This example sets the value true or false for the OnQuickLaunch.


EXAMPLE 4

Set-SPListSettings -url "http://serverName:1111" -ListName "NewDocs" -EnableModeration true -EnableMinorVersions true -MajorWithMinorVersionsLimit 5 -MajorVersionLimit 6 -DraftType 0 -ForceCheckout true


EXAMPLE 5

Set-SPListSettings -url "http://serverName:1111" –ListName "NewDocs" -ContentTypesEnabled true -ItemOpen 2 -EnableFolderCreation true –NoCrawl true -ExcludeFromOfflineClient true -IsSiteAssetsLibrary true –DisableGridEditing true -NavigateForFormsPages true




Register the cmdlet

  1. Unzip the source code.

  2. Go to the installer folder.

  3. Run Install.bat.

  4. anavijai.SP2010.PowerShell.dll will be installed in the gac.

  5. Go to 14\CONFIG\POWERSHELL\Registration and check whether anavijaiSP2010Cmdlet.xml is available.

  6. Run "SharePoint 2010 Management Shell" as administrator.

  7. Check whether the cmdlet is registered by executing the following commands.

--- Get-Command Set-SPListSettings



--- Help SPListSettings