locked
Keep getting error - A referral was returned from the server. RRS feed

  • Question

  • User-351672084 posted

    I am trying to retrieve a list of users from my AD server. I have tried several of the examples off the net and all of them return this result:

    System.DirectoryServices.DirectoryServicesCOMException (0x8007202B): A referral was returned from the server.

    I have even tried using credentials that have access to the server and no luck.

    Any ideas what might be happening?

    ~ code ~

    DirectoryEntry group = new DirectoryEntry("LDAP://cn=staffing team,dc=company,dc=com", @"username", "password");

    object members = group.Invoke("Members", null);

    foreach (object member in (IEnumerable)members)

    {

    DirectoryEntry x = new DirectoryEntry(member);

    Response.Write(x.Name);

    }

     

     

    Monday, November 12, 2007 6:21 PM

Answers

  • User1191518856 posted

    username should always be specified as domain\username. Maybe that's the problem?

    You can download Softerra's LDAP Browser for free to check if your connection works. You can also try your queries there.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 13, 2007 2:37 AM
  • User1191518856 posted

    Well, it seems you are looking for a group called staffing team, so an appropriate filter would be (cn=staffing team).

    If you search from the top, you should be able to find this object. Once you have found the object, you can copy the dn (distinguishedName) of that object and put it in your query. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 14, 2007 3:39 AM

All replies

  • User1191518856 posted

    username should always be specified as domain\username. Maybe that's the problem?

    You can download Softerra's LDAP Browser for free to check if your connection works. You can also try your queries there.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, November 13, 2007 2:37 AM
  • User-351672084 posted

    Ok I downloaded the ldap browser and can connect fine using my credentials but I can't seem to find that group. What should I use for the object filter value? (objectClass=*) is the current value.

     Regards,

    Mike

    Tuesday, November 13, 2007 3:41 PM
  • User1191518856 posted

    Well, it seems you are looking for a group called staffing team, so an appropriate filter would be (cn=staffing team).

    If you search from the top, you should be able to find this object. Once you have found the object, you can copy the dn (distinguishedName) of that object and put it in your query. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 14, 2007 3:39 AM
  • User-866517052 posted

    hello johram

    I have a similar problem but i have the groups inside Hosting in reseller organization, when i try to give the ldap path for the directory service i always run into this error, but before some times when the Domain controller was created i was able to query the AD perfeclty using the same LDAP but now out of blue this error has started coming,  For MPS HMC 4.5 i had created new forward lookup zone other than what domain i had might that be causing the problem??

    plz guide

    Thursday, November 20, 2008 4:33 AM