I have a document library that is well over 5,000 items. I need to update the document library permissions, but I'm unable to do that, whenever I try and break inheritence it gives me the warning

'The attempted operation is prohibited because it exceeds the list view threshold enforced by the administrator.'

I have also tried via the CSOM.

Surely Microsoft hasn't made it impossible to change permission once a doc library is over 5,000 files?

  • 1
    Of all the operations limited by the list view threshold, changing permissions on a document library is not one that I've seen documented. Are there many documents within the library that have unique permissions?
    – Thriggle
    Commented Jul 11, 2019 at 16:00

6 Answers 6


The work around I have used to bypass this is to delete some of the items in order to get below the 5000 item limit, then do the changes to the list and then restore the deleted items. Crude but it works

  • not possible. this doc library has well over 100,000 files.
    – Michael
    Commented Jan 29, 2019 at 23:04
  • Not a problem with Powershell as your friend Commented Jan 30, 2019 at 5:21
  • Powerhsell using CSOM same as C# code, so i dont think this will help.
    – Michael
    Commented Jan 30, 2019 at 13:39
  • It does, the trick is to get fewer than 5000 items, then you will be able to modify the library Commented Jan 30, 2019 at 16:09

Your suspicions are correct. Microsoft severely limits what you can do with that document library. If you can't temporarily move documents out, I would recommend creating a new library with the desired permissions, and migrate the documents to that one. While you're at it, you can add indexed metadata to fix the 5,000 limit permanently.

  • Unfortunately its not that easy . Ive tried splitting up libraries. the "Move TO" feature that comes with sharepoint online has a limit and fails 50% of the time. Migrating files in sharepoint is a nightmare and barely possible.
    – Michael
    Commented Jan 30, 2019 at 13:39

You can try increase list view threshold.

Here is answer how to change it

SP2013 List view threshold changed

  • 2
    not possible on SharePoint Online
    – Michael
    Commented Jan 31, 2019 at 3:42

you can use this script with proper editation for updating thousands of documents of items, just use Query collections and index:

[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client") #| Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.Client.Runtime") #| Out-Null
Add-Type -Path "c:\Program Files\SharePoint Online Management Shell\Microsoft.Online.SharePoint.PowerShell\Microsoft.Online.SharePoint.Client.Tenant.dll"

$username = "[email protected]"
$password = ConvertTo-SecureString "" -AsPlainText -Force

$siteUrl = [string]::Format("https://company.sharepoint.com/sites/site1/")
$cc = New-Object Microsoft.SharePoint.Client.ClientContext($siteUrl)
$cc.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials($username, $password)

$list = $cc.Web.GetList("/sites/site1/Lists/List1")

$query = New-Object Microsoft.SharePoint.Client.CamlQuery
$query.ViewXml = "<View><RowLimit>100</RowLimit></View>"
$i = 1
$y = 0

    Write-Host "Round $i" -ForegroundColor DarkYellow
    $listItems = $list.GetItems($query);
    foreach($item in $listItems)
            Write-Host "Updating item $($item.Id)" #"$($item.DisplayName)" -ForegroundColor Yellow
            # Update item here

            if($y -eq 10)
    $query.ListItemCollectionPosition = $listItems.ListItemCollectionPosition
while ($query.ListItemCollectionPosition -ne $null)

Hope it helps!

  • this looks like it updates every file/folder in the document library? what hapens if someone puts a new file or new folder in that doc library, it wil inherit the permission from the doc library.. so I'd need to run this script nighty?
    – Michael
    Commented Jan 31, 2019 at 3:43
  • probably yes, but after first running you can change the Query and add filter that Created is not lower than yesterdays date, so you will iterate and update only new items. Commented Jan 31, 2019 at 7:41

I would also say you should check if there are many documents within the library that have unique permissions. If you then find this is a problem, have a look at this article Solutions and workarounds for SharePoint permission limits.

If not, check Software boundaries and limits for SharePoint


Microsoft say you can't break permissions once you are over 100000 items


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.