DalekSec Posted March 20, 2024 Posted March 20, 2024 (edited) Morning, Our SharePoint to put it lightly is a mess, im slowly tidying it but its been unchecked for 5+ years before i joined so you can imagine how many random sites etc there is! My CTO has asked for a breakdown of every site and who has access to what.... Whats the best way to go about this? I could just show him who has access to each site but that won't show folders shared to guests etc.... Edited March 20, 2024 by DalekSec
DaveTheTech Posted March 20, 2024 Posted March 20, 2024 (edited) I have had to do this in the past - hopefully this PowerShell script is enough to go on. It requires the PNPOnline module to be installed. There are some variables at the top you might want to change. There are better way to get a list of sites - but my admin account didn't have SPO Admin at the time. So this is why its a list that needs to be typed out. You get a CSV with the document libraries, if a user is directly given permission, part of a group and what that group/users permissions are. I have another script that resets permissions on the files and folders to that of the document library. But I am not too sure which version worked for me. TLDR - inheritance was broken at stupid places. I had to make a change and it broke - but that caused me to fix a long running problem that was a ticking time bombsharepointPermissionFinder.ps1 Edited March 20, 2024 by DaveTheTech 2
DalekSec Posted March 20, 2024 Author Posted March 20, 2024 Thank you! Seems to work, just having a weird issue. I ran it against one site, it worked. Changed script to another site... it keeps doing the same site each time even though i've no mention of it in the script? and i've deleted the old CSV.
DalekSec Posted March 20, 2024 Author Posted March 20, 2024 Found issue, the Site is called " A B C " when its in the url it's obviously "ABC"... changed name in the script and works! Thanks
DaveTheTech Posted March 20, 2024 Posted March 20, 2024 Glad it was useful - I really ought to document and put stuff into functions.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now