Java:通过Ldap在Active Directory中创建用户时出现错误代码53
我正在尝试通过java中的ldap在Windows active Directory中创建活动用户 我的创作方法是:Java:通过Ldap在Active Directory中创建用户时出现错误代码53,java,active-directory,Java,Active Directory,我正在尝试通过java中的ldap在Windows active Directory中创建活动用户 我的创作方法是: private Attributes createUserAttributes(String userName, String firstName, String lastName, String password) { Attributes container = new BasicAttributes(); Attribute objClasses = new
private Attributes createUserAttributes(String userName, String firstName, String lastName, String password) {
Attributes 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;
}
不幸的是,我得到了以下错误:
Exception in thread "main" javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000052D: SvcErr: DSID-031A120C, problem 5003 (WILL_NOT_PERFORM), data 0
有人有什么想法吗?这将有助于回答您的问题。我的问题是密码的相关性。使用弱密码时,会显示相同的消息。验证AD上定义了哪些规则。请用堆栈填写错误