When auditing a Sharepoint environment, an important component is permissions;
- invited users
- sharing links
- inherited permissions
- unique permissions
- broken inheritance
- sites, webs
- lists, libraries
I’ve heavily modified Salaudeen Rajack’s work to share a more fully featured and faster PowerShell auditing script that will dump all unique permissions (up to item level, recursively) for all sharepoint sites (including O365 group sites). For files, folders, sites, libraries, etc etc.
It retrieves membership of groups so the resulting CSV file contains all permissions, with exception of the “Everyone” group, which is listed as a group instead.
You can find the script here: https://gitlab.com/Lieben/assortedFunctions/-/blob/master/get-SPOPermissions.ps1
- the script uses device based logon, just follow the prompts.
- don’t forget to first set permissions on all sites for your admin account, see script header for an example
- requires the PnP module
- you can exclude specific sites or users from the report if needed, configure siteIgnoreList or principalIgnoreList for that
- Runtime on an environment with over 1000 sites and millions of objects was about 6 hours. If you environment is too large, contact me and I can perhaps introduce e.g. multi-threading.