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?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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:

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Travis MartinezStorage EngineerCommented:
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.
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

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.