Re: Problem with LDAP query to resolve Email-address in C# app.



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.


.



Relevant Pages

  • Re: LDAP query in a Root Domain with a Single-Label DNS Name
    ... May I know the reason as to why my LDAP query was unable to get the 2 child ... domain records on a root domain with single-label DNS name?? ... Child Domain - 1 ...
    (microsoft.public.windows.server.active_directory)
  • Problem with LDAP query to resolve Email-address in C# app.
    ... My Organization have a primary domain controller and 5 child domain. ... My Problem is that the addresses i retrieve with this query is not the ... In the Exchange System Manager i retrieveall the addresses ...
    (microsoft.public.exchange.applications)
  • LDAP query returns data in parent domain but not from child domain
    ... This format work fine for querying membership of groups in ... DC=company,DC=com' where my user account resides. ... One thing I suspected was that I needed to tell the query where to bind so I ... the full membership of all groups in a child domain? ...
    (microsoft.public.windows.server.scripting)
  • Re: LDAP query in a Root Domain with a Single-Label DNS Name
    ... the child domains do exist under the root in that way. ... exist as crossref objects in the forest wide configuration naming context. ... Alternatively you could run a query against a Global Catlog (default port ... Child Domain - 1 ...
    (microsoft.public.windows.server.active_directory)
  • Re: On ADSI and LDAP
    ... the problem is how can I retrieve the value for myuser using the ... would be more efficient to use ADO to query AD for the attributes values. ... For more on using ADO, ... Dim adoCommand, adoConnection, strBase, strFilter, strAttributes ...
    (microsoft.public.scripting.vbscript)

Loading