How to break permissions inheritance on large libraries/ lists in SharePoint

This post describes an issue with managing permissions for large libraries or lists in SharePoint Online and how to workaround

This post describes a long-standing issue with managing permissions for large libraries or lists in SharePoint Online and gives a workaround for how you can break permission inheritance.

Intro

If you have ever tried to migrate a large volume of data into SharePoint libraries or lists you will have likely encountered an issue with trying (and failing) to break permissions inheritance on lists/ libraries following the migration.

I was recently dealing with this limitation myself as part of a migration project. We had migrated terabytes of data from on-premise file servers into SharePoint Online libraries and as we were beginning to break permissions inheritance on the library saw this error:

The issue

Faced with the problem of needing to secure lots of data that, based on the error above didn’t seem possible – I decided to refresh my memory on just what the limits of lists/ libraries are in SharePoint Online:

A list can have up to 30 million items and a library can have up to 30 million files and folders. When a list, library, or folder contains more than 100,000 items, you can’t break permissions inheritance on the list, library, or folder. 

Microsoft docs – SharePoint limits

With the above being true, the error mentions the list view threshold – which is the way SharePoint throttles and limits resources that govern the amount of data and throughput that can be managed. The list view threshold is set to approximately 5000 items by Microsoft and cannot be changed.

Now the issue with not being able to change the list view threshold, although unique to SharePoint Online isn’t a new thing – in fact it seems to have been a problem for lots of people for a long time. So if we are unable to change the list view threshold, what options do we have?

Well as it turns out the list view threshold error appears to be a bit of a red herring. I had taken a look at Microsoft guidance for managing large lists and libraries – creating indices within the library, but this had no affect as the total number of items in my library exceeded 100,000.

An example of a library that had over 100,000 files/ folders in SharePoint Online.

Workaround

The answer for me came from an inspired post on the SharePoint Stack Exchange! I give full credit for the simple, yet brilliant way to get this to work to Kasper Bo Larsen, who suggested that you should just delete enough stuff to get under 100,000 > break permissions inheritance > then restore the deleted items.

This works a treat!

Now it’s not perfect, nor would I call this a fix but if you have already migrated your data then this certainly will work for you.

Things to note

#1 Remember to break inheritance before any migration tasks begin!

I know this is a super obvious one and hindsight is always 20/20, but I’ve learnt from this mistake and built it into any future migration runbooks to break permissions inheritance before starting any migration tasks. It will save you a lot of hassle I promise…

#2 Trying to break permissions inheritance via PowerShell will yield same results

I had the thought during my investigations of this that maybe trying to break permissions inheritance via PowerShell might supersede some of the restrictions deployed to us mere GUI administrators – this was not the case and the PowerShell route fails just the same.

#3 There are no service limits or boundaries for the SharePoint recycle bin

I tried to find out if there were any limits to how much data you can restore from the SharePoint recycle bin in one go – I couldn’t find anything. With that said, I was able to restore over 60,000 files/ folders in one sitting back to it’s original location after breaking permissions inheritance so I don’t believe that will be a blocker.


5 responses to “How to break permissions inheritance on large libraries/ lists in SharePoint”

  1. Hans Petter Malme Avatar
    Hans Petter Malme

    When i try to delete a folder that’s not empty SharePoint says: Request was cancelled by event received. If attempting to delete a non-empty folder, its possible that its on hold” I am not able to delete the folder. Another annoying fact is that its not possible to know how many number of files there is within a folder structure ? Any tips 🙂 – Thanks

    1. Hi Hans, thanks for the comment. Sounds like you have a retention policy, or ediscovery hold in place on your site. These will need to be disabled to allow you to delete the folder.

      For # of files, the file size columns shows number of items for folders, but you can also use item/ child folder count too

  2. Thank you for this! I was running into this same issue and your method worked perfectly. Just crazy enough that it works. And that recycling bin is something else.

    1. Hi Daniel, thanks for your comment and glad the post helped. The recycle bin is an absolute nightmare to deal with – glad I’m not the only one!

  3. […] already wrote a separate article on how to break permissions inheritance on large libraries/ lists in SharePoint. However, I’ll summarise the key areas to watch out for and how to workaround […]

Leave a Reply to Daniel MarshCancel reply

Recent posts

Discover more from SharePoint Stuff

Subscribe now to keep reading and get access to the full archive.

Continue reading