Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted (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 by DalekSec
Posted (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.

 

spo.png

 

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 bomb

sharepointPermissionFinder.ps1

Edited by DaveTheTech
  • Thanks 2
Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...