Java: error code 53 when creating user in Active Directory by Ldap


I'm attempting to generate an active member in Windows Active folder by ldap in java.
my creation method is:
private properties createUserAttributes(String userName  String firstName  String lastName  String password) {
properties container = new BasicAttributes();
Attribute objClasses = new BasicAttribute("objectClass");
Attribute userPassword = new BasicAttribute("userPassword" password);
Attribute sAMAccountName = new BasicAttribute("SAMAccountName" userName);
Attribute userPrincipialAttribute = new BasicAttribute("userPrincipalName" userName + "@" + DOMAIN_NAME);
Attribute firstNameAttribute = new BasicAttribute("givenName" firstName);
Attribute secondNameAttribute = new BasicAttribute("sn" lastName);
Attribute activatedAccount = new BasicAttribute("userAccountControl" "512");
objClasses.add("user");
// Add these to the container
container.put(objClasses);
container.put(userPassword);
container.put(sAMAccountName);
container.put(userPrincipialAttribute);
container.put(firstNameAttribute);
container.put(secondNameAttribute);
container.put(activatedAccount);
return container;
}

Unfornutately i get the below error:
Exception in thread "main" javax.naming.OperationNotSupportedException: LDAP: error code snippet 53 - 0000052D: SvcErr: DSID-031A120C  issue 5003 (WILL_NOT_PERFORM)  data 0

Has someone solution ?



Get Source Code

  Views 126   Posted on : Saturday, May 18, 2013 12:38:24 AM
Related Tags:




Replies on "Java: error code 53 when creating user in Active Directory by Ldap" :

Nobody has replied on this post , be first to post answer.


Post Your Answer/Comment:

Please Login first to post Reply !


Note: Please Put Code into <code></code> block.




Also See: