$dom = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() 
$root = $dom.GetDirectoryEntry() 
$search = [System.DirectoryServices.DirectorySearcher]$root 
$search.Filter ="(&(objectclass=user)(objectcategory=user)(useraccountcontrol:1.2.840.113556.1.4.803:=2))" 
$result = $search.FindAll() 
foreach ($user in $result) 
{ 
$user.properties.distinguishedname 
}
