Introduction to CSVDE and LDIFDE
The main purpose of this page is to explain the differences between Microsoft’s CSVDE and LDIFDE. If you can provide data about your users, computers or contacts in a text file, then CSVDE or LDIFDE can create the corresponding account in Windows Server 2003/8 Active Directory.
The second purpose of this page is to act as a mini sitemap to guide you to my tutorials for importing and export with CSVDE and LDIFDE.
However, before I go into detail, here are three classic uses of the these Windows Server 2003 and 2008 commands;
- Bulk import of NEW user accounts. (CSVDE)
- Creation of computer accounts.
- Modification of EXISTING Active Directory accounts. (LDIFDE)
Comma Separated Value Data Exchange.
When importing accounts, always try CSVDE first because the syntax is so much easier than LDIFDE.
Another advantage of Microsoft’s CSVDE is it understands and thrives on CSV files. This means that you can manipulate the data in a spreadsheet before you import data into Active Directory.
Lightweight Data Interchange Format, Data Exchange.
My advice is use Microsoft’s LDIFDE when ever CSVDE is not up to the job, for example, if you need to import users with passwords CSVDE will not work.
LDIFDE has more powerful verbs, for instance CSVDE can only add users, whereas LDIFDE can modify or even delete their accounts.
See More on CSVDE and LDIFDE
Alternatives to CSVDE and LDIFDE
Having given an honest and fair account of both CSVDE and LDIFDE, I urge you also to consider PowerShell or VBScript for creating Active Directory accounts.
PowerShell and Active Directory
# PowerShell Connects to Active Directory
$Dom = ‘LDAP://DC=cp;DC=mosel’
Note 1: ‘LDAP://DC=cp;DC=mosel’. Rather than using the traditional .local namespace for non-internet domains, I prefer .mosel merely because it happens to be the road where I live! Naturally you changed the value for this $Dom variable in your live script? Didn’t you?
Note 2: New-Object is such an insignificant command, yet it is vital for creating objects, which we can use for connecting connect to Active Directory.
Note 3: DirectoryServices.DirectoryEntry is one of the key commands to connect to Active Directory. I think of this as a pipeline to the root of my domain’s namespace. See more on PowerShell and Active Directory
Import users from a spreadsheet. Just provide a list of the users with their fields in the top row, and save as .csv file. Then launch this FREE utility and match your fields with AD’s attributes, click and import the users.
Optionally, you can provide the name of the OU where the new accounts will be born. Download your FREE bulk import tool.
If you need more comprehensive software, download a free trial of SAM (Server & Application Monitor)
While VBScript is not as quick and is more difficult to learn, in the long term
On this page we concentrate on the essential VBscript commands necessary to build a User account in Active Directory Users and Computers. For example, GetObject("LDAP://rootDSE") and .Create("User"). Even though I am experienced at creating VBScripts, I still run manually through creating the object in Active Directory Users and Computers, the menus actions help me to rehearse the stages in my scripts.
I recommend that you logon at a Windows Server domain controller. If you are a long way from the server, Remote Desktop would be a suitable alternative. If that is not possible, you could get these scripts to work from an XP machine as a non-administrator. However, why introduce extra complications? Especially at the beginning, you want easy success, with fewest obstacles.
Instructions for Creating a User Account in Active Directory
Script to Create a User in a Named OU (Organizational Unit)
‘ Users .vbs
‘ Bind to Active Directory, Users container.
‘ Build the actual User.
‘ End of free sample Create Users VBScript.
Note 1: The first 10 lines explain the purpose of the script and declare the variables.
Note 2: The simple, but clever command, which allows the script to work with any domain is: GetObject("LDAP://rootDSE"). Crucial, this statement binds WSH / VBScript to Active directory. The next line puts the focus on the Users container, as that is where the user will be born. Incidentally, the correct syntax is cn=users, whereas OUs that you create need the OU= prefix, for example OU=Accounts,.
See More on CSVDE and LDIFDE