Oh wise VB Gurus... How can I modify this script, which creates a user in a Windows 2000 Active Directory, to accept data input from a text or HTML file?
That is, for the user name, given name, etc., it would look at fields in the file and fill it in from there.
This is the code:
'*Script to create user *
'************************
Set ou = GetObject("LDAP://OU=DEP_IT,DC=AUS,DC=mycompany,DC=com"
Set usr = ou.Create("user", "CN=Joe Smith"
'--- Mandatory Attributes----
usr.Put "samAccountName", "JSmith"
'---- Optional Attributes, you can optionally skip these----
usr.Put "sn", "Smith"
usr.Put "givenName", "Joe"
usr.Put "userPrincipalName", "Joe.Smith2@mycompany.com"
usr.Put "telephoneNumber", "(512) 123 4567"
usr.Put "title", "IT Gineau Pig"
usr.SetInfo
'--Now that the user is created, reset the user's password and
'--enable its account
usr.SetPassword "dummy"
usr.AccountDisabled = False
usr.SetInfo
********************************************
Your help much appreciated...
That is, for the user name, given name, etc., it would look at fields in the file and fill it in from there.
This is the code:
'*Script to create user *
'************************
Set ou = GetObject("LDAP://OU=DEP_IT,DC=AUS,DC=mycompany,DC=com"
Set usr = ou.Create("user", "CN=Joe Smith"
'--- Mandatory Attributes----
usr.Put "samAccountName", "JSmith"
'---- Optional Attributes, you can optionally skip these----
usr.Put "sn", "Smith"
usr.Put "givenName", "Joe"
usr.Put "userPrincipalName", "Joe.Smith2@mycompany.com"
usr.Put "telephoneNumber", "(512) 123 4567"
usr.Put "title", "IT Gineau Pig"
usr.SetInfo
'--Now that the user is created, reset the user's password and
'--enable its account
usr.SetPassword "dummy"
usr.AccountDisabled = False
usr.SetInfo
********************************************
Your help much appreciated...