Well, this is the problem... I don�t really know.
This module is a part of a bigger application, and the error occurs on
one of the customers networks. I assume there exists several forests
since it�s a big company (world-wide). Unfortunately, I can�t run any
test with e.g. LDP since they do not allow any test on their "live"
environment. I was hoping that someone might have any idea what could
cause a problem like this.
Code snippet:
dim de as new directoryEntry("LDAP://" & m_sRootDomain)
dim dsDirSearcher as new DirectorySearcher(de)
dim src as SearchResultCollection
dsDirSearcher.Filter = m_AddressBook.Filter
dsDirSearcher.SizeLimit = Options.MaxHits
dsDirSearcher.PropertiesToLoad = m_arrProperties
dsDirSearcher.ReferralChasing = ReferralChasingOption.All
dsDirSearcher.SearchScope = SearchScope.Subtree
dsDirSearcher.CacheResults = True
src = dsDirSearcher.FindAll() <---- boom, this is where it all goes to h***
Regarding Joe�s post about GC.
Which attributes are stored in the GC? I need to retrieve information
like phone numbers, name, address, mail etc.
This are the attributes I�m interested in:
givenName,sn,title,mail,company,department,info,whenChanged,physicalDeliveryOfficeName,whenCreated,userPrincipalName,targetaddress,Street,l,postalCode,c,st,telephoneNumber,facsimileTelephoneNumber,otherFacsimileTelephoneNumber,homePhone,otherHomePhone,mobile,otherMobile,otherTelephone,distinguishedname
Mikael
On Mon, 28 Feb 2005 09:52:08 -0500, joe <[EMAIL PROTECTED]> wrote:
> Hopefully JoeK will swing by shortly to say his piece on the NET call.
>
> For the queries below, unless you want them scoped at a specific domain
> anyway, consider querying a GC since all of those attribs are in the GC.
>
> joe
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mulnick, Al
> Sent: Monday, February 28, 2005 9:19 AM
> To: [email protected]
> Subject: RE: [ActiveDir] "A referral was returned from the server" when ex
> ecuting a query.
>
> Can you include the code snippet where this occurs?
>
> Have you tried using an alternate tool (LDP or Joe's ADFIND) to validate
> that you don't get the same results from those tools?
>
> ??Is this a single domain forest that you're testing in?
>
> Al
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of Mikael H�kansson
> Sent: Monday, February 28, 2005 9:06 AM
> To: [email protected]
> Subject: Re: [ActiveDir] "A referral was returned from the server" when
> executing a query.
>
> Any query throws the referral exception.
>
> Like
>
> "(& (mailnickname=*) (|
> (&(objectCategory=person)(objectClass=contact)) ))" which is from the "All
> Contacts" address list.
>
> or
>
> "(& (mailnickname=*) (|
> (&(objectCategory=person)(objectClass=user)(!(homeMDB=*))(!(msExchHomeServer
> Name=*)))(&(objectCategory=person)(objectClass=user)(|(homeMDB=*)(msExchHome
> ServerName=*)))(&(objectCategory=person)(objectClass=contact))(objectCategor
> y=group)(objectCategory=publicFolder)(objectCategory=msExchDynamicDistributi
> onList)
> ))"
> whis is from the Default Global Address list.
>
> Any ideas are welcome =)
>
> Mikael H�kansson
>
> On Mon, 28 Feb 2005 08:50:43 -0500, joe <[EMAIL PROTECTED]> wrote:
> > 1. Cool
> >
> > 2. Your search should use objectcategory, not objectclass.
> >
> > 3a. Ok
> >
> > 3b. What exactly is the query? The rest of the stuff building up to it
> > isn't throwing the referral, the query you neglect to show is.
> >
> > joe
> >
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On Behalf Of Mikael
> > H�kansson
> > Sent: Monday, February 28, 2005 4:10 AM
> > To: [email protected]
> > Subject: [ActiveDir] "A referral was returned from the server" when
> > executing a query.
> >
> > I�m working on an application for listing contacts and address lists
> > in active directory. But I get an error everytime I execute a query.
> >
> > I�m using the DirectoryServices namespace in .NET (which encapsulates
> > the Active Directory Service Interfaces) to communicate with Active
> > Directory
> >
> > 1. I bind to the RootDSE object to retrieve the DN of the
> > configuration container and the root domain.
> > According to the log file, I get:
> > Configuration container: DC=configuration,DC=myDomain,DC=com
> > Root Domain: DC=myDomain,DC=com
> >
> > 2. I connect to the configuration container and retrieve all the
> > address lists (using the directorySearcher with the filter
> > "(&(|(objectClass=addressBookContainer)(objectClass=msExchOAB))(purpor
> > tedSea
> > rch=*))"
> >
> > ... so far so good ...
> >
> > 3. I then connect using the value from the rootDomainNamingContext
> property.
> > (this gives me the path: "LDAP://DC=myDomain,DC=com") This works
> > fine.
> >
> > ... Now the problem begin ...
> >
> > I use the .NET DirectorySearcher class to execute an ldap query agains
> > active directory.
> > (the query is taken from the currently selected address list)
> >
> > Whenever I execute a query, I get an exception:
> > -2147016661 "A referral was returned from the server"
> >
> > This is usually an indication that the DN is wrong (i.e the server
> > does not exist), but it doesn�t add up since I�m able to connect and
> > retrieve the address lists.
> >
> > I have set the option to follow all referrals (subordinal & external).
> >
> > Does anyone know what might be wrong?
> > I�m pretty convinced it is not a programming error. Probably just my
> > lack of knowlegde regarding Active Directory :)
> >
> > Thanks
> > List info : http://www.activedir.org/List.aspx
> > List FAQ : http://www.activedir.org/ListFAQ.aspx
> > List archive:
> > http://www.mail-archive.com/activedir%40mail.activedir.org/
> >
> > List info : http://www.activedir.org/List.aspx
> > List FAQ : http://www.activedir.org/ListFAQ.aspx
> > List archive:
> > http://www.mail-archive.com/activedir%40mail.activedir.org/
> >
> List info : http://www.activedir.org/List.aspx
> List FAQ : http://www.activedir.org/ListFAQ.aspx
> List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
> List info : http://www.activedir.org/List.aspx
> List FAQ : http://www.activedir.org/ListFAQ.aspx
> List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
>
> List info : http://www.activedir.org/List.aspx
> List FAQ : http://www.activedir.org/ListFAQ.aspx
> List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/
>
List info : http://www.activedir.org/List.aspx
List FAQ : http://www.activedir.org/ListFAQ.aspx
List archive: http://www.mail-archive.com/activedir%40mail.activedir.org/