Error while trying to connect AD using LDAP connection

11,133

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").

Share:
11,133
Tamir
Author by

Tamir

passionate coder, always after learning new stuff, never hesitate to step outside the comfort zone, productivity junky

Updated on July 18, 2022

Comments

  • Tamir
    Tamir almost 2 years

    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?

  • LoverBugs
    LoverBugs over 2 years
    can you share how did you fix it?
  • CompanyDroneFromSector7G
    CompanyDroneFromSector7G over 2 years
    @LoverBugs Really sorry my memory won't go back that far!
  • LoverBugs
    LoverBugs over 2 years
    Enjoy, I resolved it :D thank you anyways :))