You want to import objects into Active Directory using a CSV file.
126.96.36.199 Using a command-line interface
To import objects using the csvde utility, you must first create a CSV file containing the objects to add. The first line of the file should contain a comma-separated list of attributes you want to set, with DN being the first attribute. Here is an example:
The rest of the lines should contain entries to add. If you want to leave one of the attributes unset, then leave the value blank (followed by a comma). Here is a sample CSV file that would add two user objects:
DN,objectClass,sn,userAccountControl,sAMAccountName,userPrincipalName "cn=jim,cn=users,dc=rallencorp,dc=com",user,Smith,512,jim,email@example.com "cn=john,cn=users,dc=rallencorp,dc=com",user,,512,john,firstname.lastname@example.org
Once you've created the CSV file, you just need to run cvsde command to import the new objects.
> csvde -i -f input.csv
Note that each line of the CSV import file, except the header, should contain entries to add objects. You cannot modify attributes of an object or delete objects using csvde. If you have a spreadsheet containing objects you want to import, first save it as a CSV file and use csvde to import it.
188.8.131.52 Using a command-line interface
To import with csvde, simply specify the -i switch to turn on import mode and -f <filename> for the file. It can also be beneficial to use the -v switch to turn on verbose mode to get more information in case of errors.
4.27.4 See Also
Recipe 4.26 for exporting objects in CSV format, and MS KB 327620 (HOW TO: Use Csvde to Import Contacts and User Objects into Active Directory)