Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

batch file to create a windows user account

Posted on 2009-05-15
5
Medium Priority
?
2,978 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 85

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 85

Accepted Solution

by:
oBdA earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
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…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

926 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