Need help to get this code working on Active Directory RRS feed

  • Question

  • User808322624 posted

    this test server is from http://blog.stuartlewis.com/2008/07/07/test-ldap-service/comment-page-1/#comment-3588

    The error returned below is 'invaid dn syntax has been specified'. 

    Dim dirEntry As New DirectoryEntry("LDAP://ldap.testathon.net/OU=users,DC=testathon,DC=net")  'ive tried various url variations
            'Setting username & password to Nothing forces
            'the connection to use your logon credentials
            dirEntry.Username = "stuart"
            dirEntry.Password = "stuart"
            'Always use a secure connection
            dirEntry.AuthenticationType = AuthenticationTypes.None  'ive tried various settings such as Secure,Anonymous, etc. nothing works
            Return dirEntry

    any help would be greatly appreciated!  i'm on my second advil for the day!

    Friday, July 2, 2010 4:13 PM

All replies

  • User1052258516 posted

     What are you trying to do?

    Friday, July 2, 2010 5:12 PM
  • User808322624 posted

    what i would like to do is to verify that i can code a query against an ldap server. i have this example code and a couple of others but can never verify against any test servers.  i have a vb.net application which the customer is requesting a login to their active directory, but i can even demonstarate a connection to a ldap server.  any ideas? thanks again for your help.

    Friday, July 2, 2010 5:55 PM
  • User1052258516 posted

    See this code http://www.codeproject.com/KB/system/active_directory_in_vbnet.aspx

    I tried a couple of the sample code functions (IsValidADLogin) and it worked on my domain so the code does work.

    Friday, July 2, 2010 7:15 PM
  • User808322624 posted

    I'll check out this code, but how can I test it?  I don't have AD on my xp pro computer and I don't know of a test server other than the url I sent in my earlier post.   

    My main goal is to just create a piece of code that works against the test server (http://blog.stuartlewis.com/2008/07/07/test-ldap-service/). 

    thank you.

    Friday, July 2, 2010 7:34 PM