Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.