Hello , Question - why am I getting this following error when going to add a First or Last name to a windows domain user account using ADSI. Error - "The attempted action violates the DS schema rules." Now using the same function I am able to create a new account, add a description, the full name, password with no problems. It's just when adding the First or Last name for the user account.
Here is the code:
Set objComputer = GetObject("WinNT://" & strDomain)
'Create the New User Login name.
Set objNewUser = objComputer.Create("User", strLogin)
objNewUser.SetInfo
'Set the Users Password.
objNewUser.SetPassword (strPwd)
'This causes the error:
objNewUser.FirstName = strFname
'This causes the error:
objNewUser.LastName = strLname
'Set the users Full Name
objNewUser.FullName = strFname & " " & strLname
'Set the users NT Description
objNewUser.Description = strUserNTDescription
'Add all the users into to NT
objNewUser.SetInfo
Thanks,
Frandazzo
Here is the code:
Set objComputer = GetObject("WinNT://" & strDomain)
'Create the New User Login name.
Set objNewUser = objComputer.Create("User", strLogin)
objNewUser.SetInfo
'Set the Users Password.
objNewUser.SetPassword (strPwd)
'This causes the error:
objNewUser.FirstName = strFname
'This causes the error:
objNewUser.LastName = strLname
'Set the users Full Name
objNewUser.FullName = strFname & " " & strLname
'Set the users NT Description
objNewUser.Description = strUserNTDescription
'Add all the users into to NT
objNewUser.SetInfo
Thanks,
Frandazzo