Link to home
Start Free TrialLog in
Avatar of RubinPostaer
RubinPostaer

asked on

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?
ASKER CERTIFIED SOLUTION
Avatar of Kevin Stanush
Kevin Stanush
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Travis Martinez
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
Avatar of oBdA
oBdA

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

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial