I am trying to use the below script to make a user in AD:
username = "username"
Firstname = "FirstName"
lastname = "lastname"
description = "description"
Set objOU = GetObject("LDAP://OU=TheOU,dc=MyDC,dc=com")
Set objUser = objOU.Create("User", "cn="&username)
'initial account creation
objUser.Put "sAMAccountName", username
ObjUser.Put "SN", lastname
ObjUser.Put "description", description
objUser.Put "givenName", Firstname
objUser.SetInfo
The user gets created however the Account > User logon name is blank. Any idea what I am missing?
username = "username"
Firstname = "FirstName"
lastname = "lastname"
description = "description"
Set objOU = GetObject("LDAP://OU=TheOU,dc=MyDC,dc=com")
Set objUser = objOU.Create("User", "cn="&username)
'initial account creation
objUser.Put "sAMAccountName", username
ObjUser.Put "SN", lastname
ObjUser.Put "description", description
objUser.Put "givenName", Firstname
objUser.SetInfo
The user gets created however the Account > User logon name is blank. Any idea what I am missing?