$filter = "(objectClass=user)" $searcher = $path = ([adsisearcher]$filter) $users = $searcher.FindAll() $users|%{$_.Properties.samaccountname}