General discussion

Locked

automating user creation

By k4k ·
on win2k Server at times i have to create about 50 to 100 users. i want to automate this process using some command line tools from resource kit.

I'd appreciate if u guys have any step-by-step guidelines to automate the process of creating users.

This conversation is currently closed to new comments.

1 total post (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

automating user creation

by tressdetector In reply to automating user creation

I found the script may help you. If you want to find out more about it, join the microsoft.public.windows.server.scripting community on the msnews.microsoft.com news server. To provide feedback or report bugs in sample scripts or the Scripting Guide, please contact Microsoft TechNet.


Creating 1,000 User Accounts
Description
Demonstration script that creates 1,000 user accounts (named UserNo1, UserNo2, UserNo3, etc.) in the Users container in Active Directory. The script is useful for test scenarios that require multiple user accounts.

Script Code

Set objRootDSE = GetObject("LDAP://rootDSE")
Set objContainer = GetObject("LDAP://cn=Users," & _
objRootDSE.Get("defaultNamingContext"))
For i = 1 To 1000
Set objLeaf = objContainer.Create("User", "cn=UserNo" & i)
objLeaf.Put "sAMAccountName", "UserNo" & i
objLeaf.SetInfo
Next
WScript.Echo "1000 Users created."

Back to Windows Forum
1 total post (Page 1 of 1)  

Related Discussions

Related Forums