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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User creation script with password set

Status
Not open for further replies.

itsteapot

Technical User
Mar 27, 2009
49
GB
Hi all I have a script that i have been using for some years, however this script leaves the password blank. I would like to know how to make it add the word "password" as the password.
Script below.


<script>
' VBScript to create an OU called BulkGuy
' VBScript then creates Users in OU BulkGuy
' Guy Thomas - January 2004

Dim objRoot, objDomain, objOU, objContainer
Dim strName
Dim intUser

strName ="0"

Set objRoot = GetObject("LDAP://rootDSE")
Set objDomain = GetObject("LDAP://" & objRoot.Get("defaultNamingContext"))

Set objRootDSE = GetObject("LDAP://rootDSE")
Set objOU=objDomain.Create("organizationalUnit", "ou=Bulkimport")
objOU.Put "Description", " Bulk Users OU"
objOU.SetInfo

Set objContainer = GetObject("LDAP://OU=Bulkimport," & _
objRootDSE.Get("defaultNamingContext"))

For account = 06001 To 06150
Set objLeaf = objContainer.Create("User", "cn=" & strName & account)
objLeaf.Put "sAMAccountName", strName & account
objLeaf.SetInfo
intUser = intUser +1
Next

WScript.Echo intUser & " Users created "
WScript.quit

<end of script
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top