Re: Problem with LDAP query to resolve Email-address in C# app.
- From: "Henning Krause [MVP - Exchange]" <hkrause.remove@xxxxxxxxxxxxxxxxx>
- Date: Tue, 30 May 2006 13:19:33 +0200
Hello,
using a query based on the purportedSearch is not a good thing (see http://www.infinitec.de/articles/exchange/getgal.aspx).
Another thing is, that you must do a search on the global catalog to get all addresses.
From within a the domain, do a bind on GC:
Then enumerate the childs of that object and take the first one. This object can be used as searchroot to search the entire forest.
Best regards,
Henning Krause
<alessandro.rolla@xxxxxxxxx> wrote in message news:1148973599.030552.163710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hello,
i try to create a function with a behavior like the Outlook or OWA
Ctrl-K.
My Organization have a primary domain controller and 5 child domain.
We have and Exchange Server on the primary domain e 5 child exchange
server in the 5 child domain.
I log in my primary domain controller with domain admin privilege.
I create a c# code like this:
DirectoryEntry entry = new
DirectoryEntry("LDAP://MyEchange.MyDomain.Com");
DirectorySearcher searcher = new DirectorySearcher(entry);
searcher.SearchScope=SearchScope.Subtree.
searcher.filter="(& (mailnickname=*) (|
(&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHomeServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategory=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributionList)
))";
I retrieve the query for the filter from the purportedSearch in the
Default Global Address List with ADSI edit.
My Problem is that the addresses i retrieve with this query is not the
same of the Exchange System Manager preview on the Default Global
Address List.
In the Exchange System Manager i retrieve(obviously) all the addresses
of my organization with all child domain addresses.
With my query i have only the addresses and contact(and public folder)
about the addresses in the primary domain controller but i can't
retrieve the child domain addresses.
If i copy my query on a custom query in Active Directory Users and
Computer in the same server (MyExchange.MyDomain.Com) I retrieve the
addresses of my query and not the same of the Exchange System Manager.
I think is an Entry Point Problem?
Can anyone help me please?
Thank,Alessandro.
.
- Follow-Ups:
- Re: Problem with LDAP query to resolve Email-address in C# app.
- From: alessandro . rolla
- Re: Problem with LDAP query to resolve Email-address in C# app.
- References:
- Problem with LDAP query to resolve Email-address in C# app.
- From: alessandro . rolla
- Problem with LDAP query to resolve Email-address in C# app.
- Prev by Date: Problem with LDAP query to resolve Email-address in C# app.
- Next by Date: Re: Problem with LDAP query to resolve Email-address in C# app.
- Previous by thread: Problem with LDAP query to resolve Email-address in C# app.
- Next by thread: Re: Problem with LDAP query to resolve Email-address in C# app.
- Index(es):
Relevant Pages
|
Loading