Posted by vikas vohra | 0 comments

Importing users with CSVDE

CSVDE is a command-line tool that imports or exports Active Directory objects from or to a
comma-delimited text file (also known as a comma-separated value text file, or .csv file).
Comma-delimited files can be created, modified, and opened with tools as familiar as Notepad
and Microsoft Office Excel. If you have user information in existing Excel or Microsoft Office
Access databases, you will find that CSVDE is a powerful way to take advantage of that 
information to automate user account creation.




The basic syntax of the CSVDE command is:

csvde  [-i] [-f File name] [-k]

The i parameter specifies import mode; without it, the default mode of CSVDE is export. The -f parameter identifies the file name to import from or export to. The -k parameter is useful during import operations because it instructs CSVDE to ignore errors including Object Already Exists, Constraint Violation, and Attribute Or Value Already Exists.
The import f ile itself is a comma-delimited text file (.csv or .txt) in which the first line defines
the impor ted attributes by their Lightweight Director y Access Protocol (LDAP) attribute
names. Each object follows, one per line, and must contain exactly the attributes listed on the first line. 
Here’s a sample file:

DN,objectClass,SAMAccountName,sn,givenName,userPrincipalName
"cn=Lisa Andrews,ou=People,dc=contoso,dc=com",user,lisa.andrews,
Lisa,Andrews,lisa.andrews@contoso.com

This file, when imported by the CSVDEcommand, will create a user object for Lisa Andrews in
the People OU. The user logon names, last name and first name, are conf igured by the file. 
You cannot use the CSVDE to import passwords, and without a password, the user account will be
disabled initially. After you have reset the password, you can enable the object.

0 comments: