Set ou = GetObject("LDAP://OU=Marketing,OU=DSys,DC=adsidev,DC=nttest,DC=microsoft,DC=com") Set usr = ou.Create("user", "CN=James Smith")'---- Mandatory attributes---- usr.Put "samAccountName", "jsmith"'---- Optional attributes, you may skip this---- usr.Put "sn", "Smith" usr.Put "givenName", "James" usr.Put "userPrincipalName", "[email protected]" usr.Put "telephoneNumber", "(555) 555 0111" usr.Put "title", "Marketing Administrator Dept" usr.SetInfo'--Now that the user is created, reset the user's password and '--enable its account.usr.SetPassword "secret***!" usr.AccountDisabled = False usr.SetInfo
Set usr = ou.Create("user", "CN=James Smith")'---- Mandatory attributes----
usr.Put "samAccountName", "jsmith"'---- Optional attributes, you may skip this----
usr.Put "sn", "Smith"
usr.Put "givenName", "James"
usr.Put "userPrincipalName", "[email protected]"
usr.Put "telephoneNumber", "(555) 555 0111"
usr.Put "title", "Marketing Administrator Dept"
usr.SetInfo'--Now that the user is created, reset the user's password and
'--enable its account.usr.SetPassword "secret***!"
usr.AccountDisabled = False
usr.SetInfo