I want to update employeenumber to Active Directory by using emailAddress. With SamAccountName I succeeded, but the data output from personnel system provides only full name, email and employynumber.
Here's what I have tried, but it does nothing no errors either.
import-csv "c:\folder\file.csv" | % { Get-AdUser -Filter {EmailAddress -eq "$_.EmailAddress"} | Set-AdUser -EmployyNumber $_EmployeeNumber}
csv file looks like
emailAddress,employeenumber
email@xx.com,12345-45
I'm very thankful if someone can help me with this.