|
Bumpy road to add user into Active Directory -- SSL/StartTLS |
|
Subject: Bumpy road to add user into Active Directory -- SSL/StartTLS
Author: JNDI
In response to: Bumpy road to add user into Active Directory -- userAccountControl=512
Posted on: 10/03/2012 08:44:28 PM
Let's try it again with SSL a or StartTLS secure connection.
String ldapURL = "ldaps://myAD.myCompany.com:636";
String bindDn = "CN=Administrator,CN=Users,DC=myCompany,DC=com";
String bindPwd = "password";
Sorry, it doesn't help. Same error: javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000052D: SvcErr: DSID-031A120C, problem 5003 (WILL_NOT_PERFORM), data 0
Ouch!?
>
> On 10/03/2012 08:41:25 PM JNDI wrote:
Ok, let's try one more step with userAccountControl being 512 - We want to create a normal active account with password:
try {
// Create the initial context
DirContext ctx = new InitialDirContext(env);
// Attributes to represent the user
Attributes attrs = new BasicAttributes(true); // case-ignore
// objectClass
Attribute attr = new BasicAttribute("objectClass");
attr.add("top");
attr.add("person");
attr.add("organizationalPerson");
attr.add("user");
attrs.put(attr);
// MAY attribute
attrs.put("cn", "John Smith");
attrs.put("givenName", "John");
attrs.put("sn", "Smith");
attrs.put("userPassword", "password");
attrs.put("userAccountControl", "512");
// Create the user account
ctx.createSubcontext(
"cn=John Smith,CN=Users,DC=myCompany,DC=com",
attrs);
// close
ctx.close();
} catch (NamingException e) {
e.printStackTrace();
}
Sorry, you are not allowed to do that. Here is the error message: javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000052D: SvcErr: DSID-031A120C, problem 5003 (WILL_NOT_PERFORM), data 0
Hmmm?
References:
|
|
|
|