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.

[2611 byte] By [shivendra_mca07a] at [2007-11-26 18:31:30]
# 1

Believe it or not, looks similar to the problem in the post http://forum.java.sun.com/thread.jspa?threadID=580113&tstart=0

More unbelievable is the huge security hole in your network !String adminPassword = "";

.....

env.put(Context.SECURITY_PRINCIPAL,"administrator@ControlsNet.local");

env.put(Context.SECURITY_CREDENTIALS,adminPassword);

An administrator with a blank password !

The ldap standard (rfc 2251) defines an anonymous user as a user with a null passsword. By default, Active Directory does not allow anonymous users to perform searches against the directory, let alone reset a user's password.

adler_stevena at 2007-7-9 6:05:39 > top of Java-index,Core,Core APIs...