Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create Multiple Local User Accounts with Specific Settings Windows Server 2003

Status
Not open for further replies.

blashmet

IS-IT--Management
May 22, 2012
2
US
I need to create 80 user accounts with the following information/settings:

1. Username
2. Full name
3. Description (will be the same for all users)
4. Password
5. Member of Group "Web Reporting Users (Cust)"
6. Uncheck "Connect client drives,printers at logon" and "Default to main client computer"



The following script works on my server, but it only creates the username/password. I need to modify it to add the other information. Even if you could provide a way to set the group membership that would be very helpful.


strComputer = "SERVER.DOMAIN.com"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "TestingScript")
objUser.SetPassword "09iu%4et"
objUser.SetInfo


Any help would be appreciated [smile]
 
I've made a little progress. I can now run the script and have it create the local user account with a username, password, and usergroup. I still need:

1. Description
2. Full name
3. Uncheck "Connect client drives,printers at logon" and "Default to main client computer"


Does anyone know how to add these to the following script?




'this creates the user account "TestingScript7" with the password "09iu%4et"

strComputer = "servername"
Set colAccounts = GetObject("WinNT://" & strComputer & "")
Set objUser = colAccounts.Create("user", "TestingScript7")
objUser.SetPassword "password"
objUser.SetInfo


'this adds the user "TestingScript7" to the usergroup1 group

strComputer = "wiggum"
Set objGroup = GetObject("WinNT://" & strComputer & "/usergroup1,group")
Set objUser = GetObject("WinNT://" & strComputer & "/TestingScript7,user")
objGroup.Add(objUser.ADsPath)



'this adds the user "TestingScript7" to the usergroup2 group

strComputer = "wiggum"
Set objGroup = GetObject("WinNT://" & strComputer & "/usergruop2,group")
Set objUser = GetObject("WinNT://" & strComputer & "/TestingScript7,user")
objGroup.Add(objUser.ADsPath)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top