Need to popluate hidden Active Directory attrributes from all users

How to populate hidden Active Directory attributes? I need to populate the employeeID & roomNumber attributes in AD with values from a spreadsheet. Can I just use a bulk edit tool, or do I need to define the type of data that can be entered somewhere?
RubinPostaerAsked:
Who is Participating?
 
Kevin StanushApplication DeveloperCommented:
There isn't a builtin GUI way to do this using the native tools, but there are a couple of ways to do this using either:

1. Powershell, you can find a lot of simple examples around for importing from a CSV file

2. Use a 3rd party tool, such as Hyena.  Here is a video that shows how it is used to mass-update AD:

https://www.youtube.com/watch?v=exR2FK7rQ44

Regardless of which approach you use, you will need to determine how you want uniquely identify your directory objects.  AD is a database, and like any database, you need a unique identifier both for your AD objects and a corresponding one in your input data.  Hyena uses a 'key' attribute that you set in the task, and will tell you of any duplicates or unmatched values.
0
 
Travis MartinezSmoke JumperCommented:
There is already a powershell script written that needs some tweaking based on the values you want to update.  You'll need to understand that powershell is pulling in the column names as variables and setting the values in the rows beneath.  In your case you would want to update the CSV to include the AD ID and edit the script to update based on ID rather than mass update on an OU such as this one.

It's a good start though for what you're looking for and an excellent example to begin with.

https://gallery.technet.microsoft.com/scriptcenter/PowerShell-script-to-376e9462
0
 
oBdACommented:
It's not rocket science with PowerShell (2008 R2 or later); the import file aside, it's a one-liner.
You'll need a csv like this:
SamAccountName, employeeID, roomNumber
jdoe, 1234, 42

Open in new window

The 'Import-Module ActiveDirectory' is only required if you're still running PS 2.0; PS 3.0 or later will load the module automatically:
Import-Module ActiveDirectory
Import-Csv C:\Temp\userlist.csv | % {Set-ADUser -Identity $_.SamAccountName -Replace @{'employeeID' = $_.employeeID; 'roomNumber' = $_.roomNumber}}

Open in new window

1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.