Help! I am getting an error in this script. It is my first attempt at creating a script to create a new user in Active Directory.
The Error is: There is no such object on the server.
It is occuring at char 1 of: objUser.SetPass word "W3lcome"
Thanks for the help all!
Code:
'New User firstname = InputBox("Enter First Name: ") lastname = InputBox("Enter Last Name: ") username = InputBox("Enter username: ") Set objOU = GetObject("LDAP://OU=xxx,dc=xxx,dc=xxx") Set objUser = objOU.Create("User", "cn=" & username) objUser.Put "sAMAccountName", username objUser.Put "Description", "Intern" objUser.SetPassword "W3lcome" objUser.AccountDisabled = False objUser.Put "givenName", firstname objUser.Put "sn", lastname strNewProfilePath = "\\servername\Profiles\" & username objUser.Put "profilePath", strNewProfilePath objUser.Put "scriptPath", "logon.wsf" objUser.Put "homeDirectory", "\\servername\Users" & username objUser.Put "homeDrive", "H:" objUser.SetInfo
The Error is: There is no such object on the server.
It is occuring at char 1 of: objUser.SetPass word "W3lcome"
Thanks for the help all!
Comment