pnp / PnP-PowerShell

SharePoint PnP PowerShell CmdLets
https://pnp.github.io/powershell
Other
990 stars 663 forks source link

Any scripts on how to retrieve users, groups and permissions for all sties, document library, list, etc for a SharePoint Online tenant? #2430

Open jheckccr opened 4 years ago

jheckccr commented 4 years ago

Looking to be able to produce a list of sites, document libraries, list, etc for all sites in a tenant that will also list all users/groups and permissions for each of the items in a tenant. Using SharePoint Online.

Has anyone tried doing this with PnP-Powershell?

Thank you in advance for any help with this.

Regards, John

ghost commented 4 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

jackvandeur commented 4 years ago

I was working on a set of scripts doing just that when I realized that every site has it's own administrator. So it's almost impossible unless every site has the same admin account to gather all that stuff. I am now working on a function to recurse through every folder and list the permissions all the way to user level not only group level.

gobigfoot commented 4 years ago

This is possible, but you will have to application authentication and give your app Sites.Read.All and Directory.Read.All permissions. This prevents issues where your admin accounts are not explicitly given access to all site collections.

JaggB commented 3 years ago

I too am looking for the same script, I'm trying to find each document that a specific users/AD Group has access too. It'll be running in Azure AD Runbook using an Admin Service Account, which we do already for other functionality. At the moment, we're using Sharegate but rather have it as a PowerShell in the cloud