SharePoint - How to bypass the 100'000 items limitation to manage permissions inheritance

Steel Contributor

When we are starting to convert our users from File Servers to SharePoint Online, the content loading into Document Libraries start to be complex.

Permission Manage is one of the biggest challenge, especially with the limitation implemented by Microsoft to protect their platform:

Into this limitation, one important part is:

Spoiler
When a list, library, or folder contains more than 100,000 items, you can't break permissions inheritance on the list, library, or folder. Nor can you re-inherit permissions on it. However, you can still break inheritance on the individual items within that list, library, or folder, up to the maximum number of unique permissions in the list or library (see the next section).

Many folders from File Servers have much more than 100'000 items (files+folders) and you can forget to pre-configure your document library before run the file import process.

 

If you are face to this situation you will have the following when you are going in "Library Settings"

 

DocLibWithMore100000items-01.png

 

Going in Permission part of this settings:

 

DocLibWithMore100000items-02.png

 

When you are clicking on "Stop inheriting permissions", you will have that error message:

DocLibWithMore100000items-03.png

 

At this stage, we have no solution available and the text specifying the Administrator threshold is not pointing your company Administrator, but directly Microsoft. So there is no way to change that value.

 

But, there is a "Tip" to use if you know well the content you loaded (like using TreeSize or an equivalent). Because you can look into the original folder (from file server) what are the biggest sub-folders (with less than 50'000 items).

In this case, the first 3 folders are containing more than 20'000 items, helping me to have less than this limitation:

 

DocLibWithMore100000items-04.png

 

So the solution is to go into your Document Library and select the specific folders one by one to delete it (or select many if you are sure to have less than 50'000 items as total):

DocLibWithMore100000items-05.png

 

DocLibWithMore100000items-06.png

 

DocLibWithMore100000items-07.png

 

DocLibWithMore100000items-08.png

 

When the deletion is completed, you can go in your Site Recycle Bin to control the presence of those deleted folders:

DocLibWithMore100000items-09.png

 

You can now go back into your Library Settings and control you have less than the limitation imposed by Microsoft:

DocLibWithMore100000items-10.png

 

 

You can now click on "Permissions" management link to disable the Permission inheritance on that Document Library:

DocLibWithMore100000items-11.png

 

DocLibWithMore100000items-12.png

 

DocLibWithMore100000items-13.png

 

 

When the permission set is correctly configured, you can go into the Recycle Bin, select your deleted folders and click on "Restore

 

DocLibWithMore100000items-14.png

 

After a couple of minutes, you can come back into the library settings and review the Item Total number:

DocLibWithMore100000items-15.png

 

Your situation is now fixed and you can focus on the next problem.

 

Fabrice Romelard

 

 

2 Replies

@Fabrice Romelard 

 

This worked for me but restoring is terrible. I had to select some 20'000 folders just hoping that I did not miss something..

@Eleric0 For me, the following cmdlet worked:

$deleteditems = Get-PnPRecycleBinItem -RowLimit 500000 | Where{($_.DirName -like "teams/teamName/libraryName*") -and ($_.DeletedByEmail -eq "email address removed for privacy reasons") -and ($_.DeletedDateLocalFormatted -like "11/6/2023*")} | Restore-PnPRecycleBinItem -Force

Also, see - SharePoint Online: Restore a Document from the Recycle Bin using PowerShell - SharePoint Diary