connecting Active Directory using JNDI, NamingException

  • Thread starter Thread starter dmitri
  • Start date Start date
D

dmitri

Hi,

I installed Active Directory Application Mode and try to retrieve user
data.

I get NamingException: [LDAP: error code 1 - 000020D6: SvcErr:
DSID-03100724, problem 5012 (DIR_ERROR), data 0_]; remaining name
'CN=Mary Baker, OU=ADAM users'

My code:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=Micrsoft");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "CN=Mary Baker,OU=ADAM
users,O=Microsoft,C=US");
env.put(Context.SECURITY_CREDENTIALS, "qwer1234");


try {

// Create the initial directory context
DirContext ctx = new InitialDirContext(env);
Attributes attrs = ctx.getAttributes("CN=Mary Baker, OU=ADAM users");


ctx.close();

} catch (NamingException e) {
System.err.println("Problem getting attribute:" + e);
}


What am I doing wrong? Can anybody help me?

Thank you.

Dmitri
 
Dmitri,

You might want to post this to a scripting news group. This might not be
the best possible news group for your question. Please do not misunderstand
me, you are always welcome to post such questions. You just might not
receive a useful response, though! ;-)

Cary

Tut mir leid, dass wir Dir nicht helfen konnten.
 
Back
Top