Bulk importing users into Active Directory

Requirements

  • Microsoft Excel or spreadsheet program to create csv, otherwise any text editor to do it all manually

This method is used to simplify the creation of users in bulk and to include all of the information Mac OS X requires such as home directory location.

To import users into AD, I use “csvde.exe -i - f path/to/file” to read a comma delimited text file and import the users into the Active Directory. This method seems to work well for Warilla, but unfortunately, all accounts need passwords set manually. DET has a licence for a peice of software called Hyena that can reset multiple passowrds.

I have included a table below with the fields and an example of the data in them. It is initially made in Excel with the concatenate function to create the required information from a users first name and last name.

dn CN=Joe BIGGS,OU=ImportedStaff,DC=warilla-h,DC=schools,DC=nsw,DC=edu,DC=au
givenName Joe
sn BIGGS
description Staff
postalCode 2001
telephoneNumber 200
sAMAccountName bij
homeDirectory \\\\osxhomes1\\staff\\bij
streetAddress afp://osxhomes1/staff bij
info /Network/Servers/osxhomes1/staff/bij
homeDrive Z:
displayName Joe BIGGS
userPrincipalName bij@warilla-h.schools.nsw.edu.au
objectClass user

The information should be arranged into column not rows as displayed in the data example above. A sample of what the text file should look like is included below:

dn, givenName, sn, description
CN=Joe BIGGS,OU=ImportedStaff,DC=warilla-h,DC=schools,DC=nsw,DC=edu,DC=au, Joe, BIGGS, Staff

Save the file as in CSV format. Then open a command prompt on the directory server. Enter the following command:

csvde.exe -i -f path/to/file

You should be presented with a bit of information, and a heap of . . . . . to indicate each record that has been successfully imported.

Check to make sure the users have been imported into the Active Directory. By default, hey will be disabled and have no password.

Leave a Reply