Tips & Tweaks for Windows

User Rating:  / 2

User creation script

Because of my allergy to routine I was forced to create users as efficient as possible. Also, creating users by script reduces the change of errors and makes sure that the users are created the same way every time.

Nowadays I create users like this:

CreateUser.cmd [name of the user]


CreateUser John Doe

De batchfile executes the following steps:

1. Generate firstname, lastname, accountname and displayname

2. Generate an easy-random password

3. Create the useraccount

4. Add user to some default groups

5. Create the homedirectory and profiledirectory

6. Set NTFS permissions on the homedirectory and profiledirectory

Download .cmd script: CreateUser.zip

This script is tested on Windows 2008, but should work on Windows 2000 and Windows 2003. The command line tools used are: dsadd.exe and icacls.exe (windows 2008) or cacls.exe (other versions).

TIP: Before executing, open the batchfile in notepad and adjust the global variables to match your domain environment.

This post applies to: Windows 2003, Windows 2008, Windows 2008 R2, Windows XP, Windows Vista, Windows 7.


Tips & Tweaks for Windows

Most read:



EU e-Privacy Directive

This site uses cookies for analytics, advertising and functional purposes. Please accept or decline the use of coockies on this site.

You have declined cookies. This decision can be reversed.

You have allowed cookies to be placed on your computer. This decision can be reversed.