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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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:
You'll need a csv like this:
SamAccountName, employeeID, roomNumber
jdoe, 1234, 42
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}}
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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