$de = [ADSI]''
$ads = new-object directoryservices.directorysearcher
$ads.searchroot = $de
$ads.filter = "(&(objectCategory=person)(objectClass=user)(userAccountControl:1.2.840.113556.1.4.803:=8388608))"
$result = $ads.findall()
foreach ($user in $result) 
{ 
$user.properties.distinguishedname 
}
