Google Reviews
If you find this content or our services useful, please leave us a review.

Other Posts in this Series:

This post provides a simple example of how we can use ADSI to search users in Active Directory.  You may wish to further optimise this by using LDAP filters.

$searcher=[adsisearcher]'(&(objectCategory=person)(objectClass=user))'
$searcher.PageSize = 200

$colProplist = "samaccountname"
foreach ($i in $colPropList) { $searcher.PropertiesToLoad.Add($i) | out-null } 
        
$Users = $searcher.findall()
foreach ($user in $Users) {
       write-host ($user.Properties).samaccountname
}      
Use ADSI to Search Users in Active Directory
Comments have now been disabled. If you have a question to ask about this post please ask the community!