#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0

    Connect to LDAP using C# entry.Guid exception


    Hey gang! I'm trying to connect to an ldap server using C#. So far, none of the examples I've found in any of my google or bing searches has worked. I'm starting to think it's a security thing I don't know how to program for. I'm able to connect to the ldap file using JXplorer, Softerra LDAP Admin, so I know I have the correct rights. I also created my own username and password for it. Here's where I think the problem is. The username and password I created is for a "trusted server" and requires I enter either my IP address, or computer name. I "think" that might be the problem. Maybe my IP isn't getting pushed across in my C# code? Here's what I'm trying to use to connect:

    Code:
    DirectoryEntry entry = new DirectoryEntry("LDAP://10.2.13.10:389/ou=people,dc=avaya", 
                        "cn=DaveAPC,dc=avaya", "quicken1", AuthenticationTypes.None);
    The error I get is:

    Code:
    'entry.Guid' threw an exception of type 'System.Runtime.InteropServices.COMException'
    Which when I drill down, shows this:

    Code:
    base {System.SystemException} = {"Exception from HRESULT: 0x8000500D"}
    and this:

    Code:
    _exceptionMethod = {System.String get_GUID()}
    No one on the C# forum I belong to even tried to touch this one...

    Does anyone here have any idea why I can't connect to the ldap server..

    Thanks for any help!

    Dave
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Posts
    2
    Rep Power
    0
    Figured it out...basically fixed my AuthenticationTypes. Set it to Delegation and it worked.

    Dave

IMN logo majestic logo threadwatch logo seochat tools logo