Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error while trying to connect AD using LDAP connection

Trying to use this code to connect the AD

PrincipalContext context = new PrincipalContext(ContextType.Domain, domain)

but i got the error saying:

The LDAP server is unavailable.

Any idea?

like image 922
Tamir Avatar asked Jun 21 '09 09:06

Tamir


People also ask

What is LDAP connection error?

The reason "Connect error" means that Pexip Infinity cannot verify the LDAP server's certificate. Ensure that the LDAP server's TLS certificate (or the CA certificate that signed it, if it is not self-signed) is in the Pexip Infinity trust store (Platform > Trusted CA certificates).

Can't connect to the LDAP server?

Cannot contact LDAP Server: If you receive a "Cannot connect to the LDAP Server" error message, try to connect using the LDAP Server IP address. You should also check to be sure the LDAP machine is running. Another possibility is that the SSL certificate files are not valid.


1 Answers

The questions is: do you specify our domain as

  • "mydomain.com" (DNS format)
  • or as "dc=mydomain,dc=com" (AD-style format)

To my surprise, the Domain name must be in DNS format (e.g. "mydomain.com") in order for this to work (and NOT in the usual AD-style format of "dc=mydomain,dc=com").

like image 111
marc_s Avatar answered Sep 22 '22 00:09

marc_s