Get all sids, all computer object ACLs, and find RBCD!!!
December 18, 2019 · View on GitHub
computeracls = Get-DomainComputer | select -exp dnshostname | get-domainobjectacl; "Got computer ACLs"; "Search through acls for RBCD..."; foreach (computeracls) { foreach(usersid) { acl | ?{.SecurityIdentifier -eq .ActiveDirectoryRights -Like 'GenericAll' -or _.ActiveDirectoryRights -Like 'WriteOwner')} } }
Get all SIDS, all computer object ACLs, and find RBCD
groups = Get-DomainGroup | Where-Object {.SamAccountName -ne "Account Operators" -and .SamAccountName -ne "Administrators" -and .SamAccountName -ne "Schema Admins" -and .SamAccountName -ne "Enterprise Key Admins" -and _.SamAccountName -ne "Storage Replica Administrators"} | select -exp objectsid; "Got group SIDS"; computeracls = Get-DomainComputer | select -exp dnshostname | get-domainobjectacl; "Got computer ACLs"; "Search through acls for RBCD..."; foreach (computeracls) { foreach(groupsid) { acl | ?{.SecurityIdentifier -eq .ActiveDirectoryRights -Like 'GenericAll' -or _.ActiveDirectoryRights -Like 'WriteOwner')} } }
Get all computer object SIDS, all computer object ACLs, and find RBCD
computeracls = Get-DomainComputer | select -exp dnshostname | get-domainobjectacl; "Got computer ACLs"; "Search through acls for RBCD..."; foreach (computeracls) { foreach(computersid) { acl | ?{.SecurityIdentifier -eq .ActiveDirectoryRights -Like 'GenericAll' -or _.ActiveDirectoryRights -Like 'WriteOwner')} } }