The below code will return generic OU permissions
Import-Module ActiveDirectory
set-location AD:
$OUAcl = (Get-Acl 'OU=ParentOU,OU=ChildOU,DC=test,DC=test,DC=com').Access
$OUAcl
However what I want to audit is the advanced security permissions. I can view this in the GUI, I just can't figure out how to script it to generate a report for every OU in my organization (or specific OU's depending on our needs).
To view in the GUI do this:
- Open MMC and load the ADUC snapin
- Enable View → Advanced Features
- Right-click any OU, choose Properties
- Choose the Security tab on the properties window
- Click the Advanced button.
- View all the users/groups that have permissions to that OU.
What I want is a report that can dump out every user and group that has access to the OU, and all of their advanced permissions (eg: anything in step 6 that has the box checkes whether it's allow or deny).
I found this site, but it doesn't get to the detail I need.
Is this possible through PowerShell?