SharePoint Online - Remove user access from a list of folders via PowerShell

%3CLINGO-SUB%20id%3D%22lingo-sub-1734265%22%20slang%3D%22en-US%22%3ESharePoint%20Online%20-%20Remove%20user%20access%20from%20a%20list%20of%20folders%20via%20PowerShell%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1734265%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20everyone%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20a%20SharePoint%20Team%20site%20with%20several%20folders%20in%20the%20Document%20Library.%20Each%20folder%20has%20access%20permissions%20for%20specific%20users.%20When%20checking%20the%20%22manage%20access%22%20section%20in%20the%20SharePoint%20site%2C%20we%20realised%20that%20a%20lot%20of%20folders%20still%20show%20users%20who%20have%20been%20removed%2Fdeleted%20and%20are%20not%20working%20for%20our%20company%20anymore.%20Is%20there%20a%20quick%20way%20(--%26gt%3BPowerShell%3F)%20to%20go%20through%20each%20folder%20and%20remove%20those%20users%20from%20the%20%22access%20list%22%20instead%20of%20doing%20that%20manually%2C%20one%20folder%20at%20a%20time%3F%20Those%20users%20are%20not%20members%20of%20the%20related%20Team%20anymore%2C%20and%20they%20are%20not%20in%20AzureAD%2C%20so%20I%20can't%20explain%20why%20they%20are%20still%20shown%20in%20the%20SharePoint%20Team%20site.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20greatly%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrancesco%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1734265%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EDocument%20Library%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPermissions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPowerShell%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Occasional Contributor

Hello everyone,

 

We have a SharePoint Team site with several folders in the Document Library. Each folder has access permissions for specific users. When checking the "manage access" section in the SharePoint site, we realised that a lot of folders still show users who have been removed/deleted and are not working for our company anymore. Is there a quick way (-->PowerShell?) to go through each folder and remove those users from the "access list" instead of doing that manually, one folder at a time? Those users are not members of the related Team anymore, and they are not in AzureAD, so I can't explain why they are still shown in the SharePoint Team site.

 

Any help would be greatly appreciated.

 

Francesco 

0 Replies