Problem during the changing of Password in Active Directory
Hello All !
I am facing a problem during the password modification
in active directory, i got the same exception as other are getting i.e
javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 00002077: SvcErr: DSID-03190959, problem 5003 (WILL_NOT_PERFORM), data 0
Can any body help me how i will come to know that 128 bit
Encryption is done successfully. Although i Installed the MS High Encryption Pack but it's registry is not done in Conrol Panel.
is this a problem(as i think) ?
I am giving the code please check it out->
import java.util.Hashtable;
import javax.naming.*;
import javax.naming.ldap.*;
import javax.naming.directory.*;
//import java.io.*;
//import javax.net.ssl.*;
//import java.security.*;
import java.io.UnsupportedEncodingException;
public class setpassword
{
public static void main (String[] args)
{
Hashtable env = new Hashtable();
String adminPassword = "";
String userName = "ou=MCA,ou=Trainee,dc=ControlsNet,dc=local";
String newPassword = "yadav";
String keystore = "D:\\j2sdk1.4.2_12\\jre\\lib\\security\\cacerts";
System.setProperty("javax.net.ssl.trustStore",keystore);
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"administrator@ControlsNet.local");
env.put(Context.SECURITY_CREDENTIALS,adminPassword);
env.put(Context.SECURITY_PROTOCOL,"ssl");
String ldapURL = "ldap://gateway.ControlsNet.local:636/";
env.put(Context.PROVIDER_URL,ldapURL);
try {
LdapContext ctx = new InitialLdapContext(env,null);
ModificationItem[] mods = new ModificationItem[1];
String newQuotedPassword = "\"" + newPassword + "\"";
byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("unicodePwd", newUnicodePassword));
ctx.modifyAttributes(userName, mods);
System.out.println("Reset Password for: " + userName);
ctx.close();
}
catch (NamingException e) {
System.out.println("Problem resetting password: " + e);
}
catch (UnsupportedEncodingException e) {
System.out.println("Problem encoding password: " + e);
}
}
}
Please reply me immideiately as soon as you see this problem.
I think some of u already solved this problem. thanks in advance.

