TheTechGuide Forum
General Category => Software => Topic started by: Twinkie on August 21, 2002, 11:26:14 AM
-
Once a year I need to add about 100 users or so to the domain. While I can find software to do this it is expensive and has way more features than I will ever need. I have been working on a vbs file to mass import the accounts with little success. I am using the M$ KB post http://www.microsoft.com/technet/treeview/...to/bulkstep.asp (http://\"http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/ad/windows2000/howto/bulkstep.asp\") for my only reference but the script they post is not working for me. Anyway, anyone run into this or solve it perhaps. I have the accounts in a csv file FirstName,LastName,Discription. If I could get the vbs file to work and then import line by line out of the file that would be great. Any Ideas?
-
Okay the update:
Finally got a good script to add users to Active Directory. Works amazingly well. Even I did not botch it. I am still working out getting it to auto-insert the list of users though. I don\'t have much experiance playing with array, dim and redim commands. Hell, not even sure those are the commands I am looking for.
Start VBS:
Set ou = GetObject(\"LDAP://OU=Test,DC=tech-hints,DC=com\")
Set usr = ou.Create(\"user\", \"CN=Twinkie Cream\")
\'--- Mandatory Attributes----
usr.Put \"samAccountName\", \"twinkie\"
\'---- Optional Attributes, you can optionally skip these----
usr.Put \"sn\", \"Cream\"
usr.Put \"givenName\", \"Twinkie\"
usr.Put \"userPrincipalName\", \"[email protected]\"
usr.Put \"displayName\", \"Twinkie Cream\"
usr.SetInfo
\'--Now that the user is created, reset the user\'s password and
\'--enable its account
usr.SetPassword \"techhints\"
usr.AccountDisabled = False
usr.Put \"PasswordExpired\", CLng(1)
usr.SetInfo
save as adduser.vbs and your done.