0

I need to login on LDAP on my Windows Server.

First of all do i need to have anything enabled on my DC?

Than my code for connecting look like this:

Console.WriteLine("Connect to LDAP mydomain");

        Console.Write("Enter your username: ");
        string username = Console.ReadLine();

        Functions.maskInputString();
        string password = Console.ReadLine();

        DirectoryEntry directoryEntry = new DirectoryEntry("LDAP://mydomain", username, password)

        Console.ReadKey();

Can i do like some conditions for DirectoryEntry directoryEntry = new DirectoryEntry("LDAP://mydomain", username, password)

If login was succesful or not?

Because now when i enter username and password i dont know if connection is established or not.

Thanks for answers.

pmg
  • 106,608
  • 13
  • 126
  • 198
Johny Corbie
  • 63
  • 10
  • Possible duplicate of [Using C# to authenticate user against LDAP](https://stackoverflow.com/questions/11561689/using-c-sharp-to-authenticate-user-against-ldap) – Hintham Jan 08 '19 at 08:22
  • dc tag removed -- "dc is an arbitrary precision calculator which reads instructions from standard input or files." – pmg Mar 11 '19 at 16:54

0 Answers0