Bulk change the employee ID from a .csv file
NYAdmin
1
Reputation point
I have a csv file with a list of (student)employee ID that are set incorrect and we need to update them to the new ID in the CSV file. I get an error message saying cannot find an object with Identity.
$Students = Import-Csv -Delimiter "," -Path "C:\Users\admin\Desktop\StudentIDChangeTest.csv"
foreach ($Student in $Students)
{
$SAM = $Student.USERNAME
$StudentID = $Student.STUDENTID
Set-ADUser $SAM -Add @{employeeID="$StudentID"}
}