wlcsd-networkmanager
asked on
Compare static list of usernames against Active Directory
I have a static list of usernames that I want to compare against Active Directory to determine if they exist or not. The list of names is in text format. Ideally, I would like to know if the object exists even if the account is disabled.
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
Oops. Just leave the .SamAccountName off of the $_
ASKER
Works great. Thanks for the tip.
$user=Get-QADUser $_
If ($user -ne $null)
{Write-Host "$_.SamAccountName User Account Found"}
Else {Write-Host "$_.SamAccountName User Account *NOT* Found"}
}