Hi @Naveen Kumar ,
you didn't mention which attribute you are using for the Manager
.
Assuming it's the SamAccountName as well this might help (not tested by myself).
Import-Csv "c:\temp\adinfo.csv" |
ForEach-Object {
$userObj = Get-ADUser -Filter "SamAccountName -eq '$($_.SamAccountName)'"
$managerObj = Get-ADUser -Filter "SamAccountName -eq '$($_.Manager)'"
if ($userObj -and $managerObj) {
$userObj | Set-ADUser -Manager $managerObj -Title $_.Title -EmployeeID $_.EmployeeID -Department $_.Department
}
}
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten