Solved

Net User /add batch file

Posted on 2009-05-12
8
1,219 Views
Last Modified: 2013-11-10
Hello
is it possible to use net user to create a user account on another computer in a workgroup?
ex. run net user /add from station 1 to create a user on station2 via a batch file.
0
Comment
Question by:schuitkds
  • 5
  • 3
8 Comments
 
LVL 8

Expert Comment

by:zoubi77
ID: 24368716
If you do not need to create a bunch of users, try using "Computer management". You can connect to any computer in domain and add groups and users
0
 
LVL 8

Expert Comment

by:zoubi77
ID: 24368737
But if you still need scripting tools than take a look at ADDuser tool from MS

http://support.microsoft.com/kb/199878

0
 

Author Comment

by:schuitkds
ID: 24368801
I need to create the same user on multiple machines in a workgroup environement.
0
Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

 
LVL 8

Expert Comment

by:zoubi77
ID: 24368912
than use adduser tool I mentioned in previous link. You can create file with user attributes and create that user on remote machine

C:\>AddUsers [\\computername] /c c:\Users.txt /p:e
0
 

Author Comment

by:schuitkds
ID: 24368959
no i need to does this in a batch file if possible
0
 
LVL 8

Expert Comment

by:zoubi77
ID: 24369205
It is possible. Go and download ADDUSERS
http://www.petri.co.il/download_free_reskit_tools.htm 

Than Create a comma-delimited text file, which contains the new users and groups to be created. Syntax is section-specific for each entry (line) in the different sections, as follows:

[Users]
User Name,Full name, Password, Description, HomeDrive, Homepath, Profile, Script

[Global]
Global Group Name, Comment, UserName, ...

[Local]
Local Group Name, Comment>, UserName, ...

The entries (lines) in the [Local] and [Global] group sections can have 0 or more UserName entries after the comment field. Each user name is added to that group. Lines must end with a comma (or the appropriate separator character). Here is the example from the Resource Kit Tools Help file for AddUsers.exe:

[User]
jimmy,James Edward Phillip II,,,,,,
alex,Alex Denuur,,,E:\,E:\users\alex,,
ron,Ron Jarook,hello,,E:\,E:\users\ron,,
sarah,Sarah Selly,,,,,,
mike,Mike Olarte,,,,,,

[Global]
TestTeam,Regression,ron,alex,
DevTeam,Conversion to Sources,mike,sarah,jimmy,

[Local]
UsersAM,Users A through M,alex,jimmy,mike,
UsersNZ,Users N through Z,ron,sarah


Creating the users (and groups) can be performed through a batch file or at the command line. The following command creates the users and groups listed in a text file called Users.txt. The "/p" switch creates the users with the Passwords Never Expire option enabled:

C:\>AddUsers [\\computername] /c c:\Users.txt /p:e

Once you crated users.txt file just use this command to and change computername. You can create batch file. You yust copy,paste&change computername

@Echo off

cd %path_to_addusers.exe_file%
AddUsers \\computer1 /c c:\Users.txt /p:e
AddUsers \\computer2 /c c:\Users.txt /p:e

%path_to_addusers.exe_file% is directory where you extract addusers.exe


0
 

Author Comment

by:schuitkds
ID: 24369934
okkkk   thats more software to upload to the remote sites then
i also need to hide the account for administrative purposes.
i
0
 
LVL 8

Accepted Solution

by:
zoubi77 earned 500 total points
ID: 24371919
For hiding users on welcome screen follow this link - http://www.intelliadmin.com/blog/2006/09/hide-user-accounts-from-windows-xp.html

if you prefere scripting - http://www.dougknox.com/xp/scripts_desc/xp_hide_users.htm

as for creating users...you only need to download ONE single file - adduser.exe. On the PC that you downloaded file to, you create list of users and then run either adduser.exe (with parameters) or your own script (as I described in my posts)
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

820 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