connection of ldap with asp.net(c#)

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Mahak Dhawan
    New Member
    • Apr 2010
    • 3

    #1

    connection of ldap with asp.net(c#)

    hi...please provide me help in making connection of ldap with asp.net(c#). as i am a newbie so please give the full source code.
    thanks in advance... :)
  • tlhintoq
    Recognized Expert Specialist
    • Mar 2008
    • 3532

    #2
    There is a complete explanation and programmers guide to LDAP on the MSDN site.
    http://msdn.microsoft.com/en-us/libr...08(VS.85).aspx

    TIP: Performing a google search with "MSDN" and the subject you need help in will usually take you right to the MSDN page. For example I found the above page by Googling for "MSDN LDAP"

    From the programming guide provided my Microsoft you should be able to get yourself going. If your code is producing errors you can't find, or not producing the results you were expecting then please feel free to post your code along with any errors or descriptions of how it is not meeting your expectations and someone here (probably many someones) will jump in and help you clean up your code.

    Comment

    • Mahak Dhawan
      New Member
      • Apr 2010
      • 3

      #3
      hi thanks for ur reply..can u tell me that when i am specifying the connection string then how to make the path ?
      First is O=tboglobal ..under that there are CN and OU..!!!
      I want to match the username with the members(cn) inside the OU and CN..!!!
      can u pls help me ??

      Comment

      • Curtis Rutland
        Recognized Expert Specialist
        • Apr 2008
        • 3264

        #4
        This is the blog entry I learned how to query Active Directory from several years ago.

        I found it through a Google search with the terms: "c# ldap query" which I would suggest you try in the future.

        As to the question of us providing help, our purpose here is not to give you the answer, but to help you figure out the answer yourself. We do not believe that doing your work for you makes you a better programmer. That's why we ask that you show us the effort you've made, so we can point out where you've gone wrong and help you do it properly.

        Learning comes from effort.

        Comment

        • Mahak Dhawan
          New Member
          • Apr 2010
          • 3

          #5
          thanks...
          well this is my code...pl temme where am i goin wrong..
          Code:
          DirectoryEntry entry= new DirectoryEntry("LDAP://geo.l.tboglobal.com:389/OU=GBO,DC=tboglobal,DC=com");
                 
                   entry.AuthenticationType = AuthenticationTypes.Anonymous;
                  
                   DirectorySearcher searcher = new DirectorySearcher(entry);
                   searcher.PropertiesToLoad.Add("cn");
          
              
                   SearchResultCollection results = default(SearchResultCollection);
                   results = searcher.FindAll();
          i am getting an error-"parameter incorrect"
          Last edited by tlhintoq; Apr 23 '10, 02:28 PM. Reason: [CODE] ...Your code goes between code tags [/CODE]

          Comment

          • mikee1504
            New Member
            • Aug 2012
            • 1

            #6
            I suspect the answer is no longer relevant but the error generated can be a result of either LDAP not accepting anonymous auth OR the LDAP conn string is incorrect.
            Last edited by Niheel; Aug 4 '12, 11:17 PM. Reason: cleaned up thread, lot of Off Topic posts

            Comment

            Working...