Tuesday, April 22, 2008

How to import users to Active Directory using csvde

Sometimes you need to add many users to your domain, something like this could be time consuming, so today i would like to show you how to import users from an excel sheet, will first of all we have to prepare our users excel sheet, our excel sheet, i gonna attach an example file,
Download the example file from here
you can simply modify the first example and fill the sheet excel with your users, then you have to save the file as csv (comma-separated values)










Now after we finished preparing our sheet, we have to import it to the Active directory, we will use cvsde command (this file doesn't exist in Windows XP if you want to use it copy it from windows\system32\ of Windows 2003 to windows\system32\ of Windows XP
now the command syntax will be like this:
cvsvde -i -f D:\Example.csv -j F:\
-i stand for import mode (the default is export)
-f stand for file (its need the full path to the csv file
-j Stand for logging (you have to specify the path of log)













If you are running this command from Windows XP so you have to add -s servername

so the syntax will be like this:
cvsvde -i -f D:\Example.csv -s servername

you have to give a special attention to DN field, here you can identify where the user gonna be exist in which OU
for instance if i want to add a user named Ahmed in an OU named Accts so the DN field will look like this:

cn
=Ahmed,ou=Accts,dc=MyDomain,dc=net

I hope that you find it useful, see you soon :-)


1 comment:

Andrew said...

Can you add the example XLS sheet back. I get an error when trying to view it.

لعرض عدد الهارد ديسك المتصل بالكمبيوتر:   #!/bin/bash foo=$(lsblk | grep -c ^sd*) final=$[$foo-1] printf '%b\n' "You have...