Find-InterestingDomainAcl
To get the SID of an object:
$sid = Convert-NameToSid wley
To get ACL:
Get-DomainObjectACL -Identity * | ? {$_.SecurityIdentifier -eq $sid}
Reverse search & Mapping to a GUID value:
PS C:\\htb> $guid= "00299570-246d-11d0-a768-00aa006e0529"
PS C:\\htb> Get-ADObject -SearchBase "CN=Extended-Rights,$((Get-ADRootDSE).ConfigurationNamingContext)" -Filter {ObjectClass -like 'ControlAccessRight'} -Properties * |Select Name,DisplayName,DistinguishedName,rightsGuid| ?{$_.rightsGuid -eq $guid} | fl
Creating a list of domain users:
Get-ADUser -Filter * | Select-Object -ExpandProperty SamAccountName > ad_users.txt