Remove User from all Sharing Links of a SharePoint Online Document Library

%3CLINGO-SUB%20id%3D%22lingo-sub-2938368%22%20slang%3D%22en-US%22%3ERemove%20User%20from%20all%20Sharing%20Links%20of%20a%20SharePoint%20Online%20Document%20Library%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2938368%22%20slang%3D%22en-US%22%3E%3CP%3EI%20need%20to%20remove%20a%20user%20from%20a%20SharePoint%20document%20library.%20I%20already%20remove%20him%20from%20the%20team%2C%20but%20there%20are%20many%20Sharing%20Links%20which%20he%20can%20still%20use.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20library%20has%20more%20than%20100000%20documents%2C%20so%20it's%20not%20possible%20to%20go%20to%20each%20single%20document%20and%20check%20manually.%20There%20are%20also%20more%20then%201000%20Sharing%20Links.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHow%20can%20I%20completely%20remove%20the%20user%20from%20the%20document%20library%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2938368%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPermissions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Contributor

I need to remove a user from a SharePoint document library. I already remove him from the team, but there are many Sharing Links which he can still use.

 

The library has more than 100000 documents, so it's not possible to go to each single document and check manually. There are also more then 1000 Sharing Links.

 

How can I completely remove the user from the document library?

2 Replies
Take a look a what you can do with the SharePoint Online API or PnP PowerShell cmdlets
Thank you! I am first trying to understand where all those permission might "hide". I think I have come across two places that need special care, after a user is removed from a SharePoint site:

1) SharingLinks: those are SharePoint member groups, which are connected to files and links.

2) Directly assigned permissions to files. Those seem not to be removed after removing a SharePoint member.

I would need to iterate those sets and remove the user if found inside. Are there any other places that I should look at?