Solved

Net User /add batch file

Posted on 2009-05-12
8
1,208 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
 
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
DevOps Toolchain Recommendations

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

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Batch to Restart Remote Computers 4 78
how to split multiple lines delimiter : 8 77
C# code editing and collaboration 3 98
Basic Java Case or If-Else statement... 3 43
This is an explanation of a simple data model to help parse a JSON feed
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.
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 …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

932 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now