Import users from CSV file into Active Directory – the easy way
OK, this is a task that probably everyone been faced with… Kinda boring.. There’s a lot of ways and tools to do it: ldifde, csvde, powershell, vbscript…
However my favorite is this one-liner with the help of Joe’s admod tool:
admod -csv -add -import -unsafe -cont < .\UserImport.csv
(unsafe to import a lot of objects, cont to continue importing if an entry fails)
It will create disabled users, with blank password, and change password at first logon attribute set. It seems the fastest and easiest method (thanks to Tomek for pointing this out to me).
Your CSV just needs to have DN as the first value. If you are wondering what attributes to add to the file, there’s a ton…
My sample is:
Oh, and if you are adding manager attribute, of course you need to make sure the manager account is on the list before the “managed” person.
If you are wondering what else to add, whole list of attributes for your reference is attached here.
If you want to modify your users after that use Tomek’s tip with adfind, admod combination.