Connect to LDAP with C#


I'm trying to figure out how to connect to LDAP via C#.

The only address that I've got is the following:


I have tried to follow the following guide:

But they are using a <user> <pwd> <domain> for the credentials. Which is the domain?

I have also tried this:

DirectoryEntry directoryEntry = new DirectoryEntry("LDAP://");

But when I run that, I only get the following:

base {System.Runtime.InteropServices.ExternalException} = {System.Runtime.InteropServices.COMException (0x8007052E): The user name or password is incorrect.

       at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail)
       at System.DirectoryServices.DirectoryEntry.Bind()
       at System.DirectoryServic...

What username and password is it asking for? I only want to connect to LDAP, and then just specify a username to get data about that user. No password.

asked on Stack Overflow Jan 30, 2018 by Bryan • edited Feb 16, 2019 by halfer

0 Answers

Nobody has answered this question yet.

User contributions licensed under CC BY-SA 3.0