Last active
March 3, 2022 02:27
-
-
Save dev-2null/28930d0cd5a6774951692dbda28fbeb7 to your computer and use it in GitHub Desktop.
Powershell one liner to retrieve RBCD information with security descriptors resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
([adsisearcher]::new(([adsi]"LDAP://OU=OU,DC=domain,DC=net"),"(msDS-AllowedToActOnBehalfOfOtherIdentity=*)")).FindAll()| ForEach-Object {$_.Properties["distinguishedname"]; ConvertFrom-SddlString (New-Object Security.AccessControl.RawSecurityDescriptor([byte[]]$_.Properties["msds-allowedtoactonbehalfofotheridentity"][0],0)).GetSddlForm([Security.AccessControl.AccessControlSections]::Access) | select DiscretionaryAcl|fl} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment