我正在尝试使用 UnboundID LDAP SDK 将组添加到我的 Active Directory 服务,并不断收到错误 503:将无法执行。
我已经验证我正在使用 SSL 连接,并且我正在与属于 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')