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: ActiveDir@mail.activedir.org 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))(purportedSea 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/