Skip to content

Instantly share code, notes, and snippets.

@dev-2null
Last active March 3, 2022 02:27
Show Gist options
  • Save dev-2null/28930d0cd5a6774951692dbda28fbeb7 to your computer and use it in GitHub Desktop.
Save dev-2null/28930d0cd5a6774951692dbda28fbeb7 to your computer and use it in GitHub Desktop.
Powershell one liner to retrieve RBCD information with security descriptors resolved
([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