我正在尝试将用户添加到Active Directory中
记住:
使用SSL
证书确定
密码正常
使用组关联,可以正确创建用户。
当我尝试将用户与群组关联时,我收到以下错误:
javax.naming.OperationNotSupportedException:[LDAP:错误代码53 - 0000209A:SvcErr:DSID-031A1021,问题5003(WILL_NOT_PERFORM),数据0
我使用了DN和NAME组属性,但都没有用。
我的代码是:
ctx = getContext();
ctx.createSubcontext(entryDN,entry); // it works fine
Attribute memberOf1 = new BasicAttribute("memberOf","NAME_OF_THE_GROUP");
Attributes atts = new BasicAttributes();
atts.put(memberOf1);
ctx.modifyAttributes(entryDN, LdapContext.ADD_ATTRIBUTE, atts); // ## it doesn't work
我尝试了LdapContext.ADD_ATTRIBUTE和LdapContext.REPLACE_ATTRIBUTE。
此外,我尝试添加具有其他属性的组,但所有情况都给了我相同的错误。
有谁知道发生了什么事?
干杯!