POWERSHELL - Get-ADUsers based on LDAP filter

$users = ("user1","user2",...,"usern")
foreach ($user in $users) {Get-ADUser -ldapfilter "(displayname=$user)" '
 -Property DistinguishedName | Select-Object -Property DistinguishedName}

No comments:

Post a Comment