Create a Bulk user creation script on Windows Server 2008

user-managementuserswindows-server-2008

The script below (create_user_list.bat) loops and creates 30 users. It works well on Windows Server2003 but is breaking on Server 2008. The error that is received is 'System error 5 has occured. Access is denied'.

Is there a permision level that needs to be changed in order to run the script?

set number=0

:start_loop
set /A number=%number%+1
if %number% GTR 30 goto end

net user company%number% i3z9nto! /add /comment:"10.5.2011" /expires:never /fullname:"Company User %number%" /passwordchg:no
net localgroup "Remote Desktop Users" company%number% /add

goto start_loop

:end

Best Answer

You need to run it with UAC elevation.

If you're running the batch file directly, right-click and Run As Administrator. If you're doing it from a command prompt, then run cmd.exe as administrator instead.

Related Topic