ldap connection string

Last post 11-19-2007 9:56 AM by juanjismo. 6 replies.

Sort Posts:

  • ldap connection string

    09-25-2006, 3:56 PM

                          LDAP://CN=username,OU=subdirectory,OU=parentdirectory,DC=mydomain,DC=org

    LDAP://mydomain.org/CN=username,OU=subdirectory,OU=parentdirectory,DC=mydomain,DC=org

     

    What is the difference between the 2? and why do we write the mydomain.org next to the ldap://, in the second connection string?

     

    Thanks

    Always_Another_Way

  • Re: ldap connection string

    09-26-2006, 12:37 AM
    • Loading...
    • bdesmond
    • Joined on 06-15-2002, 6:02 PM
    • Chicago, IL USA
    • Posts 944
    • TrustedFriends-MVPs
    The mydomain.org in the second is unnecessary and irrelevant here. The text ahead of the / is for specifying a server to bind to e.g. LDAP://mydc/dc=mydomain,dc=org. If you don't specify a server (which is preferable when working with AD), the host will contact a logically close domain controller.
    --Brian Desmond
    Windows Server MVP - Directory Services
    http://www.briandesmond.com
  • Re: ldap connection string

    09-26-2006, 9:05 AM
    • Loading...
    • dunnry
    • Joined on 06-24-2002, 12:17 PM
    • http://directoryprogramming.net
    • Posts 1,806
    • TrustedFriends-MVPs

    The only times you really need to specify this is when you are doing things from either a non-domain security context or from another domain.  If you are in the same domain and with a domain security context, then serverless binding (DN alone) is a good choice.  What can occasionally bite you is unrecognized custom schema from one domain to another needs the netbios or FQDN domain name in the server position - what happens is that the trusted domain does not know where to go to download the abstract schema, so it uses its own and hence the custom schema is missing.  Admittedly, this is a bit of an edge case, but I have seen it a time or two.  More common, if you are running the code as a different domain account or a local account, the process does not know how to find that domain from the DN alone - so the server or domain name is helpful to help it resolve it.

    Edit:  I should mention that it is sorta-kinda a serverless bind when you put the domain name there instead of a server, but it does not use the exact same mechanisms, so we don't call it a serverless bind (even though there is no server there). 

     

  • Re: ldap connection string

    11-19-2007, 8:00 AM
    • Loading...
    • juanjismo
    • Joined on 11-19-2007, 7:58 AM
    • Posts 4
    hello friends i have a very big pro
  • Re: ldap connection string

    11-19-2007, 8:00 AM
    • Loading...
    • juanjismo
    • Joined on 11-19-2007, 7:58 AM
    • Posts 4
    hello friends i have a very big problem
  • Re: ldap connection string

    11-19-2007, 8:00 AM
    • Loading...
    • juanjismo
    • Joined on 11-19-2007, 7:58 AM
    • Posts 4
    hello friends i have a very big problem beacause
  • Re: ldap connection string

    11-19-2007, 9:56 AM
    • Loading...
    • juanjismo
    • Joined on 11-19-2007, 7:58 AM
    • Posts 4

    hello

    i'm in dificulties with ldap connections in .net. The error message is "The server is not operational"

    i have a ldap directory (Critical Path manufacture) installed in mocrosoft net with a Active Directory (envirioment)

    in other side i have a web application in other domain

    when a i conncet using .net library System.DirectoryServices for ldap directories 

    Any idea about it? ...

     

     

    PD

    [COMException (0x8007203a): The server is not operational]
       System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +705
       System.DirectoryServices.DirectoryEntry.Bind() +10
       System.DirectoryServices.DirectoryEntry.get_AdsObject() +10
       System.DirectoryServices.DirectorySearcher.FindAll(Boolean findMoreThanOne) +199
       System.DirectoryServices.DirectorySearcher.FindAll() +10
       LDAP.LDAP.Obtenercod(String user) in C:\Cgpj\CGPJ.2007\1.Fuentes NET\Componentes\CGPJLDAP\LDAP\LDAP.vb:77
       Decanatos.login.Button1_Click(Object sender, EventArgs e) in C:\Cgpj\CGPJ.2007\1.Fuentes NET\Decanatos\login.aspx.vb:45
       System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
       System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +57
       System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +18
       System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
       System.Web.UI.Page.ProcessRequestMain() +1292

Page 1 of 1 (7 items)
Microsoft Communities
Page view counter