Solved

batch file to create a windows user account

Posted on 2009-05-15
5
2,955 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 84

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 84

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Step by step guide to Clean and Sort your windows registry! Introduction: Always remember: A Clean registry = Better performance = Save your invaluable time In this article we're going to clear our registry manually! Yes, manually! The e…
If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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