Active directory 使用“未绑定”添加组条目时,将不执行错误503

Active directory 使用“未绑定”添加组条目时,将不执行错误503,active-directory,unboundid-ldap-sdk,Active Directory,Unboundid Ldap Sdk,我试图使用未绑定的LDAP SDK将组添加到Active Directory服务中,并不断收到错误503:将不执行 我已经验证了我正在使用SSL连接,并且我正在与属于Administrators组的用户连接,除非我弄错了,否则Administrators组授予他创建新条目的权利 我还将LDAP接口事件的日志记录级别一直提高到了5,并且事件查看器注册了许多事件,这些事件在解释为什么服务不愿意执行我的创建条目操作时都没有用处 你知道是什么导致了这个问题吗 下面是我正在使用的scala代码示例: va

我试图使用未绑定的LDAP SDK将组添加到Active Directory服务中,并不断收到错误503:将不执行

我已经验证了我正在使用SSL连接,并且我正在与属于Administrators组的用户连接,除非我弄错了,否则Administrators组授予他创建新条目的权利

我还将LDAP接口事件的日志记录级别一直提高到了5,并且事件查看器注册了许多事件,这些事件在解释为什么服务不愿意执行我的创建条目操作时都没有用处

你知道是什么导致了这个问题吗

下面是我正在使用的scala代码示例:

val connection = connect("MyAdminUser", "MyAdminPass")

val addGroupResult = connection.add("CN=TestGroup2,OU=Groups,OU=mydomain,DC=mydomain,DC=local",
    new Attribute("objectClass", "top", "group"),
    new Attribute("name","TestGroup2"),
    new Attribute("sAMAccountName","TestGroup2"),
    new Attribute("sAMAccountType","268435456"),
    new Attribute("objectCategory","CN=Group,CN=Schema,CN=Configuration,DC=mydomain,DC=local"),
    new Attribute("cn","TestGroup2"),
    new Attribute("distinguishedName","CN=TestGroup2,OU=Groups,OU=mydomain,DC=mydomain,DC=local"),
    new Attribute("instanceType","4"),
    new Attribute("groupType","-2147483646")
    )

private def connect(user: String, pass: String) = {
    val options = new LDAPConnectionOptions()
    options.setFollowReferrals(true)
    val sslUtil = new SSLUtil(new TrustAllTrustManager())
    val socketFactory = sslUtil.createSSLSocketFactory()
    new LDAPConnection(socketFactory, options, host, securePort, DN(user), pass)
}
下面是我收到的错误消息:

Exception in thread "main" LDAPException(resultCode=53 (unwilling to perform), errorMessage='0000209A: SvcErr: DSID-031A104A, problem 5003 (WILL_NOT_PERFORM), data 0', diagnosticMessage='0000209A: SvcErr: DSID-031A104A, problem 5003 (WILL_NOT_PERFORM), data 0')

我的错误是在添加操作中包含太多属性,其中一些属性不应该手动设置,而是由SAM(安全帐户管理器)设置

正确的代码如下:

val addGroupResult = connection.add("CN=TestGroup2,OU=Groups,OU=simpleBI,DC=domain,DC=local",
            new Attribute("objectClass", "top", "group"),
            new Attribute("name","TestGroup2"),
            new Attribute("sAMAccountName","TestGroup2"),
            new Attribute("objectCategory","CN=Group,CN=Schema,CN=Configuration,DC=domain,DC=local")
            )
注意,我已经删除了一些属性,包括被AD拒绝的sAMAccountType。我还删除了一些冗余的属性。我相信我拥有的是满足我需求的最小属性集

连接代码未更改