Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Updating ActiveDirectory employeenumber by using email address

$
0
0

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.


Viewing all articles
Browse latest Browse all 6937

Trending Articles