Solved

Net User /add batch file

Posted on 2009-05-12
8
1,225 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
[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
  • 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
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
convert Systemjs to Webpack 3 122
Scan Network and Export Reg value to single file 2 58
Crashing when deleting value with no child in Binary Tree 4 63
Data Analysis 7 58
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

739 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