Hello,
I am trying to get users from AD by Importing CSV. Earlier I was able to see which users in CSV does not exist in AD by adding user’s fullname variable to catch block and catch block was showing full name of missing users. It stops working somehow. Can you please suggest why.
Thanks
$UsersCSV = Import-CSV -path "C:\users\username\Downloads\FinalUserstoMove.csv"
ForEach($User in $UsersCSV){
Try{
$FullName = $User."Display Name"
$Username = $User."Username"
Get-ADUser -Identity $Username | Select Name
}
Catch { Echo "$Fullname does not exist in AD"}
Finally { }
}