locked
Invalid DN syntax in Driectory Entry using VB.Net RRS feed

  • Question

  • User676520890 posted

    Hi,

    I am very new to LDAP and working around to connect to LDAP using .Net. I have been getting this error since past 2 days. 



            de.Username = "uid=edeplex,ou=users,ou=internal,o=Ericsson"
            de.Password = "@WSX4rfv"
            Try
                With oSearcher
                    .SearchRoot = de
                    .PropertiesToLoad.AddRange(ResultFields)
                    .Filter = "cn=" & pFindWhat & "*"
                    oResults = .FindAll()
                End With

     Dim de As New DirectoryEntry("LDAP://abc.aaaaa.se:389/dc=abc,dc=aaaaa,dc=se")

            de.Username = "uid=xyz,ou=users,ou=internal,o=aaaaa"

            de.Password = "@*@*@*"

         

                With oSearcher

                    .SearchRoot = de  '----- Here it gives me error that invalid DN syntax

                       .Filter = "cn=" & pFindWhat & "*"

                    oResults = .FindAll()

                End With




    Can any one please suggest me what can be the problem ?


    Tuesday, July 13, 2010 12:26 PM

Answers

  • User676520890 posted

    I got it working. 


    i should declare 

    Dim de As New DirectoryEntry("LDAP://abc.aaaaa.se:389")


    Thanks,

    Dulari

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 13, 2010 5:44 PM