It is useful to be able to discover which accounts have been configured to store the password with reverse encryption
$ou = "OU=England,DC=Manticore,DC=org" "`nMicrosoft" Get-ADUser -LdapFilter "(&(objectclass=user)(objectcategory=user)(useraccountcontrol:1.2.840.113556.1.4.803:=128))" | Format-Table Name, DistinguishedName "`nAD provider" Get-ChildItem -Filter "(&(objectclass=user)(objectcategory=user)(useraccountcontrol:1.2.840.113556.1.4.803:=128))" ` -Path Ad:\"DC=Manticore,DC=org" -Recurse | Format-Table Name, DistinguishedName "`nQuest" Get-QADUser -LdapFilter "(&(objectclass=user)(objectcategory=user)(useraccountcontrol:1.2.840.113556.1.4.803:=128))" | Format-Table Name, DN "`nScript" $root = [ADSI]"" $search = [adsisearcher]$root $search.Filter = "(&(objectclass=user)(objectcategory=user)(useraccountcontrol:1.2.840.113556.1.4.803:=128))" $search.SizeLimit = 3000 $results = $search.FindAll() foreach ($result in $results){ $result.Properties | select @{N="Name"; E={$_.name}}, @{N="DistinguishedName"; E={$_.distinguishedname}} }
Because we are testing the userAccountControl we need to use an LDAP filter in all cases. None of the cmdlets have a parameter for this one unfortunately.