I'm trying to make a check in Powershell where I have a list of AD users inside a variable and then check if each one of those usernames exist in AD. If they do it will add those to another variable and if it doesn't it will output those to stdout that it's not found.
For example the input variable would be something like:
$CHECKUSERS = bakerc fosterv englesp
And if bakerc and englesp exist in AD using Get-ADUser (or a different command if there is a better option) it would then add them to another variable like:
$VERIFIEDUSERS = bakerc englesp
It then outputs fosterv to stdout:
fosterv not found