Trouble Connecting MS Exchange
hi,
i got the following error message when i try to connect to an ms exchange server.
javax.naming.NamingException: [LDAP: error code 1 - 00000000: LdapErr: DSID-0C090627, comment: In order to perform this operation a successful bind must be completed on the connection., data 0, vece; remaining name '(OU=TESTUSER)'
The same paramters used in an vb program worked.
any idea what the problem could be?
I create the context as follows
Hashtable env =new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,"LDAP://192.168.100.23:389");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"cn=Administrator");
env.put(Context.SECURITY_CREDENTIALS,"");
LdapContext ctx =new InitialLdapContext(env,null);
SearchControls ctls =new SearchControls();
ctls.setReturningObjFlag(true);
ctls.setSearchScope(SearchControls.SUBTREE_SCOPE);
String[] ret_attr =new String[]{"displayName","mail"};
ctls.setReturningAttributes(ret_attr);
// Specify the search filter to match any object
// Search for objects using filter
NamingEnumeration ret = ctx.search("(OU=TESTUSER)","", ctls);

