Link to home
Start Free TrialLog in
Avatar of schuitkds
schuitkds

asked on

Net User /add batch file

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.
Avatar of zoubi77
zoubi77
Flag of Slovenia image

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
But if you still need scripting tools than take a look at ADDuser tool from MS

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

Avatar of schuitkds
schuitkds

ASKER

I need to create the same user on multiple machines in a workgroup environement.
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
no i need to does this in a batch file if possible
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


okkkk   thats more software to upload to the remote sites then
i also need to hide the account for administrative purposes.
i
ASKER CERTIFIED SOLUTION
Avatar of zoubi77
zoubi77
Flag of Slovenia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial