Solved

Net User /add batch file

Posted on 2009-05-12
8
1,201 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
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 …
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…

757 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

20 Experts available now in Live!

Get 1:1 Help Now