Friday, February 16, 2007

Script vbs create users in Active Directory from csv

You can find the original script on http://techrepublic.com.com/5208-6230-0.html?forumID=101&threadID=204384&start=0.

The script was changed in order to....run and do all the job :)
....
Set oContainer = GetObject(LDAP://OU=Teste,DC=local)
.....
oNewUser.SetInfo
' Change the users password
oNewUser.SetPassword sPassword
oNewUser.Put "pwdLastSet", -1
oNewUser.SetInfo
' Enable the user account
oNewUser.Put "userAccountControl", 512
oNewUser.SetInfo
...
oRecordSet.MoveNext
Loop
oRecordSet.Close
oConnection.Close
' --------- End of user account creation