Search against mail attr with Exch 5.5 returns empty set
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Mike_Darretta
Posted On:   Thursday, November 21, 2002 10:40 AM

I am having difficulty retrieving all mailboxes in our Exchange 5.5 server. This code works for Exchange 2000, but returns an empty result set for 5.5: Hashtable env = new Hashtable(10); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, url); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, username); env.put(Context.SECURITY_CREDENTIALS, password); context = new InitialDirContext(env); String [] RETURN_ATTRIBUTES = {"..."}; Attributes matchAttrs = new BasicAttributes(true); // Here is the offending attribute   More>>


I am having difficulty retrieving all mailboxes in our Exchange 5.5 server. This code works for Exchange 2000, but returns an empty result set for 5.5:



			
Hashtable env = new Hashtable(10);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, username);
env.put(Context.SECURITY_CREDENTIALS, password);

context = new InitialDirContext(env);

String [] RETURN_ATTRIBUTES = {"..."};

Attributes matchAttrs = new BasicAttributes(true);

// Here is the offending attribute
matchAttrs.put(new BasicAttribute("mail", null));

return context.search(key, matchAttrs, RETURN_ATTRIBUTES);



I can retrieve all 'real' users by searching against the surname, and the mail attribute does in fact exist. Is the "null" attribute value the issue? Is there a better way to search for all entries that have a valid value for the said attribute. Any assistance would be appreciated.

   <<Less
About | Sitemap | Contact