Hello,
This is my context : data transfer from an annuary to an AD.
At first, data are stored in ldif files and I take information I need to create an AD account. I saw in many forums that we must create first the account without a password, and then modify it, adding the password.
The creation of the AD account with the attribute userAccountControl set to 546 or 514 works well (Normal Account = 512, Account Disabled = 2 et Password not Required = 32). On the other hand, when I want to modify the created account in order to set the userAccountControl attribute to 512 with a password (unicodePwd attribute), there is a problem.
I would want to assign the default value "example" to the account password (which the user will have to modify at his first loggin). This password must be encoded in Unicode UTF-16, and before the unicode conversion is done the password needs to be surrounded by double quotes which do not belong to the user's password. So I write it this way : unicodePwd = "\"example\"".getBytes("UTF-16LE").
And I have the following error : Cannot invoke trim() on the array type byte[], because of the fact that trim() applies to Strings I guess.
I tried to convert the unicodePwd into String, I also have an error, but not the same : [LDAP: error code 53 - 0000001F: SvcErr: DSID-031A0FC0, problem 5003 (WILL_NOT_PERFORM), data 0.
So how can I prevent trim() to do that? Or Did I understand well the mechanism of unicodePwd and userAccountControl ?
Thank you for your help