Hello,
You can do it what you will have to do is:
- Search for the manager user based on the email address
- Modify the target user manager with the previously user object you get from 1
Below an example :
$CSV = Import-Csv -path Example_csv.csv -Delimiter ";"
foreach($line in $CSV) {
$Manager = Get-ADUser -LDAPFilter "(mail=$($line.UserEmail))"
Set-ADUser xxx -Manager $Manager
}
My CSV look like this :
UserEmail;ManagerFullname
john@keyman .com;Tim Wang
Regards,