Thursday, October 01, 2009

How to create users in Windows 2003, the easy way

If you use Windows Server 2008 and you need to create users in your Active Directory there is a good way to do it.

  • You will need to use MS Excel for creating the command line to create your users.
  • You will need to have administrative rights for the server where you wish to create the users on.
The normal is to get the name of the user and the email. It is ideal to get all the rest automatically.

Your Excel file should start like that:




How to separate a name from a lastname in Excel and divide them in 2 columns?

The first problem is that you might want to separate the Name from the Lastname in order to have a better DB or just to make a mail merge for a future email notifying with the new username and password. The formula (Office 2007) should be like that:


To retrieve the lastname the formula would be like that:


Then you can use any other formula or algorithm to generate the passwords. After you have that information you need the column that will generate the command line:



Of course the formula considers the names of the columns as I created them but you can modify that. The formula is not so visible on the image so here you have it: ="net user"&" "&Table1[[#This Row];[Username]]&" "&Table1[[#This Row];[Password]]&" /add /domain"

Then you will see how Excel magically transforms the information you have (emails and names) in the full command line you need for creating your users using the command prompt.

The last advise is to copy and pasthe the all the column, excluding the name of the column, in a TXT file to avoid problems of formatting. Now you can rename the the TXT file into a BAT file. The file should be moved to the server and executed, all the users would get instantly created.




0 comments:

Tu comentario será moderado la primera vez que lo hagas al igual que si incluyes enlaces. A partir de ahi no ser necesario si usas los mismos datos y mantienes la cordura. No se publicarán insultos, difamaciones o faltas de respeto hacia los lectores y comentaristas de este blog.