Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Employee ID Update in Active Directory

Posted on 2016-08-18
2
Medium Priority
?
488 Views
Last Modified: 2016-09-02
Hi Experts,

I need to update employee ID in our active directory and we have three different domain including branch offices and intend to use the same/common AD attribute for all of our domain. I have found the following power shell script to update employee ID in the active directory but not sure which available AD attribute it will use.

reference url
https://gallery.technet.microsoft.com/scriptcenter/e9bafc1a-b5b1-4663-8e25-b0d0ea28c2b2

PS script :
Import-module ActiveDirectory
Import-CSV "C:\Scripts\Users.csv" | % {
$mail = $_.mail
$ID = $_.EmployeeID
$user = Get-ADUser -Filter {mail -eq $mail}
Set-ADUser $User.samaccountname -employeeID $ID
}

Sample CSV

Users.csv
mail,employeeid
user1@test.com, 1111
user2@test.com, 2222
user3@test.com, 3333

Could you please advise the script is ok or any other PS script that I can use.
0
Comment
Question by:ipsec600
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 22

Accepted Solution

by:
Joseph Moody earned 1000 total points
ID: 41761395
This script will work fine. It requires a CSV with two columns. The first should have the user's email address. The second should have the user's employee ID.

You may want to add a -whatif parameter to the end of the Set-ADUser $User.samaccountname -employeeID $ID line while you are testing this script.
0
 
LVL 11

Assisted Solution

by:Tim Edwards
Tim Edwards earned 1000 total points
ID: 41761869
It is going to populate the employeeID Attribute in Active Directory...

AD_attribute.PNG
and as Joseph stated
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Microsoft Office 365 is a subscriptions based service which includes services like Exchange Online and Skype for business Online. These services integrate with Microsoft's online version of Active Directory called Azure Active Directory.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question