I am trying to create a proof of concept to show how to connect to an LDAP
server and how to search for values but I do not get anywhere. Here is what I
have so far:
Dim objEntry As DirectoryEntry
Dim objSearcher As DirectorySearcher
Try
objEntry = New DirectoryEntry("ldap://www.openldap.com/dc=OpenLDAP,dc=org",
Nothing, Nothing, AuthenticationTypes.Anonymous)
objSearcher = New DirectorySearcher(objEntry, "(ou=People)")
objSearchResult = objSearcher.FindOne()
If Not objSearchResult Is Nothing Then
'Do something
End If
Catch ex As Exception
result.Text = ex.Message & vbNewLine & ex.Source
End Try
My code fails at the line:
objSearchResult = objSearcher.FindOne()
with the unhelpfu error of Unknown error (0x80005000)
As you can see I use the www.openldap.com directory and I can connect
anonymously using the Softeerra LDAP Browser 2.5
Any help would be greatly appreciated