Solved

batch file to create a windows user account

Posted on 2009-05-15
5
2,944 Views
Last Modified: 2012-05-07
Hello
   I am looking to create a batch file that will create an admin user on windows xp machines in a workgroup setting.
I also need to make this user account hidden.
I would like to be able to run this once and have it update 3 -6 computers in the workgroup.

any ideas????
thanks
0
Comment
Question by:schuitkds
  • 2
  • 2
5 Comments
 
LVL 31

Expert Comment

by:Frosty555
ID: 24401523
"Microsoft Windows NT Server Resource Kit Supplement 3" comes with a command line program called "ADDUSERS", which lets you create users by specifying an input text file with informatino about the users to create.

You could write a batch file that calls this EXE.

See this webpage:
http://tech.cuip.net/logins/docs/Addusers-overview.htm
0
 
LVL 83

Expert Comment

by:oBdA
ID: 24402424
Try the script below. Note that you can NOT "hide" the account itself; you can just prevent it from showing up on the logon screen.
You can use psexec (http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx) to run this remotely on other machines (assuming those machines all have the same administrator account and password), and there's no firewall preventing remote access.
Put the computer names into a list and run this command:
psexec @"C:\Temp\Computerlist.txt" -u "Administrator" -p "Password" -c C:\Temp\CreateUser.cmd
@echo off
set UserID=JDoe
set FullName=Doe, John
set Comment=Administrative user
REM Set Password to * to be prompted, to the password otherwise; do not use < > | % & ^
set Password=*
REM Create the user:
net user "%UserID%" "%Password%" /fullname:"%FullName%" /usercomment:"%Comment%" /add
REM Add him to the Administrators group:
net localgroup "Administrators" "%UserID%" /add
REM Remove account from logon screen:
reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList" /d "%UserID%" /t REG_DWORD /v "0"

Open in new window

0
 

Author Comment

by:schuitkds
ID: 24403996
does every computer in the workgroup need the psexec on it to run this command or can i run it from one system?
0
 

Author Comment

by:schuitkds
ID: 24403998
will this work for xp and 2000 systems??
0
 
LVL 83

Accepted Solution

by:
oBdA earned 500 total points
ID: 24404309
You only need psexec on the machine on one system; that's its purpose.
The script will work for both, only the reg key will have no function in W2k.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We have adopted the strategy to use Computers in Student Labs as the bulletin boards. The same target can be achieved by using a Login Notice feature in Group policy but it’s not as attractive as graphical wallpapers with message which grabs the att…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question