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

    Join Date
    Jun 2005
    Posts
    6
    Rep Power
    0

    Finding AD root name


    Hi,

    My application performes LDAP search, and i don't have the DN input parameter, so i have to get it by myself...
    I find out the following way:
    I pass NULL to ldap_bind_s insteasd of the the Domain DN parameter, then i call ldap_search_s with NULL as DN to start search param and LDAP_SCOPE_BASE as Scope.
    As a result i get a single entry with the property "rootDomainNamingContext" that contains the Root Domain Name that i was looking for.

    So, is it a better way to find this Root domain name?
    and what willl the use of binding with NULL parameter instead of DN affects?

    Thanks,
    Yifat
  2. #2
  3. Psycho Canadian
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Jan 2001
    Location
    Canada
    Posts
    4,846
    Rep Power
    635
    I believe that's all you can do, bind with NULL get the root dn, then disconnect and reconnect with the correct dn. At least that is what I'd do.

IMN logo majestic logo threadwatch logo seochat tools logo