Enable Item-Level Permissions on Document Library in SharePoint using PowerShell

Requirement: Enable item level permissions in SharePoint document library.

SharePoint Lists provide item level security options such as “Read items that were created by the user” or “Create items and edit items that were created by the user” under “Advanced Settings” page in SharePoint list settings.

But you don’t get these options to set Item level security in SharePoint document libraries! Say your requirement is to restrict users to view and edit other’s documents and allow only their own documents in a document library! If you need these options, you can utilize PowerShell to enable Item level permissions on SharePoint document libraries as there is no UI available!

item level permission in sharepoint 2013 document library

These settings configures ReadSecurity and WriteSecurity properties of SPList object.

Change Read Security with PowerShell:

$web = Get-SPWeb "http://Your-SharePoint-Site"
$list = $web.Lists["Your Document Library Name"]
$list.ReadSecurity = 2
$list.Update()
$web.Dispose()

Where:

  • Read all items: 1
  • Read items that were created by the user: 2

Change Write Security permissions programmatically:

$web = Get-SPWeb "http://Your-SharePoint-Site"
$list = $web.Lists[“Your Document Library Name”]
$list.WriteSecurity = 2
$list.Update()
$web.Dispose()

Where:

  • Create and edit All items: 1
  • Create items and edit items that were created by the user: 2
  • None: 4

Please note, These settings will not have any effect for Site owners and administrators!

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

3 thoughts on “Enable Item-Level Permissions on Document Library in SharePoint using PowerShell

  • March 8, 2021 at 7:26 PM

    Never mind, I was able to set the Item-Level permission in SharePoint Online, Document Library, using the pnp powershell you shared in one of your blog titled “How to Set Item-Level Permissions in a List?”, link below. Much appreciated for the great work!

    #Read more: https://www.sharepointdiary.com/2019/05/sharepoint-online-set-item-level-permission-in-list.html#ixzz6oYAtLLFA”.

    Reply
  • February 26, 2021 at 7:57 PM

    I guess the above powershell only works in SharePoint On-premise document library. Do you have similar powershell to use for SharePoint online Document library? Thank you so much!

    Reply
  • August 7, 2020 at 11:06 AM

    Sadly – document library item level permissions have been deprecated. Now you have to explicitly create folders and share it for each person in your team.

    Reply

Leave a Reply