我正在尝试使用 UNBoundID LDAP sdk 更改 AD 密码,如下所示。
try{
LDAPConnection connection=new LDAPConnectionObject().getConnection();
PasswordModifyExtendedRequest passwordModifyRequest =
new PasswordModifyExtendedRequest(
user, // The user to update
oldPass, // The current password for the user.
newPass); // The new password. null = server will generate
PasswordModifyExtendedResult passwordModifyResult;
try
{
passwordModifyResult = (PasswordModifyExtendedResult)
connection.processExtendedOperation(passwordModifyRequest);
System.out.println("passwordModifyResult---"+passwordModifyResult);
}
catch (LDAPException le)
{
le.printStackTrace();
passwordModifyResult = new PasswordModifyExtendedResult(
new ExtendedResult(le));
}
LDAPTestUtils.assertResultCodeEquals(passwordModifyResult,
ResultCode.SUCCESS);
String serverGeneratedNewPassword =
passwordModifyResult.getGeneratedPassword();
}catch(LDAPException e){
e.printStackTrace();
}
}
它抛出错误如下,
LDAPException(resultCode=2 (protocol error), errorMessage='0000203D: LdapErr: DSID-0C090C7D, comment: Unknown extended request OID, data 0, vece , diagnosticMessage='0000203D: LdapErr: DSID-0C090C7D, comment: Unknown extended request OID, data 0, vece
有人可以纠正我吗?
提前致谢