At the first step you sould connect to ldap with SSL to modify password of agents then you should unicode your password string with UTF-16LE
I put a sample for you :
String quotedPassword = '\"' + agent.getPassword() + '\"';
byte[] unicodePassword;
DirContext sctx = null;
try {
unicodePassword = quotedPassword.getBytes("UTF-16LE");
} catch (UnsupportedEncodingException uee) {
throw new LdapAccessException("Cannot encode password" + "???? ???? ???? ??? ????? ???????", uee);
}
ModificationItem[] mods = new ModificationItem[2];
mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("unicodePwd", unicodePassword));
mods[1] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("userAccountControl", Integer.toString(Agent.UF_NORMAL_ACCOUNT + Agent.UF_DONT_EXPIRE_PASSWD)));
modifySecurely(agent, mods);