[ADSISearcher]$searcher="(&(objectcategory=person)(objectclass=user))" $searcher.pagesize=50 $users=$searcher.FindAll() #display the number of users Write-Host "There are $($users.count) users in this domain." -foregroundcolor cyan #display user properties foreach ($user in $users) { foreach ($user in $users) { $entry= $user.GetDirectoryEntry() $entry |Select displayname,samaccountname,description,distinguishedname } }