Tuesday, June 28, 2011

Automating windows user creation and add then to a group ...

 Automating windows user creation and add then to a group ...






Two steps involved:

1. Create the user

2. Add the user to a group you want


=== Step 1 ====

net user admin4    infinity43@! /add /passwordreq:yes
net user admin5    infinity43@! /add /passwordreq:yes
net user admin6    infinity43@! /add /passwordreq:yes


Microsoft Windows [Version 6.0.6001]
Copyright (c) 2006 Microsoft Corporation.  All rights reserved.

C:\Users\Administrator>net user admin2 infinity43@! /add /passwordreq:yes
The account already exists.

More help is available by typing NET HELPMSG 2224.


C:\Users\Administrator>net user admin3 infinity43@! /add /passwordreq:yes
The command completed successfully.


C:\Users\Administrator>notepad addusers.bat



=== Step 2 ===


net localgroup Administrators /add    admin1
net localgroup Administrators /add    admin2
net localgroup Administrators /add    admin3
net localgroup Administrators /add    admin4
net localgroup Administrators /add    admin5





C:\Users\Administrator>net localgroup Administrators /add       admin35
The command completed successfully.


C:\Users\Administrator>net localgroup Administrators /add       admin36
The command completed successfully.


C:\Users\Administrator>net localgroup Administrators /add       admin37
The command completed successfully.












No comments:

Post a Comment