I am trying to query a public LDAP in my VB.NET application. The LDAP is not Active Directory. I found an example on the net, which makes no reference to AD. My test is based on that example. When I run this sample, an exception occurs, and I get the error "An operations error occurred.".
Suggestions are welcome.
Suggestions are welcome.
Code:
Dim oRoot As DirectoryEntry = New DirectoryEntry("LDAP://123.12.12.1/ou=MYORG,ou=EXTERN,o=MO,c=CA") 'not the real IP
Dim oSearcher As DirectorySearcher = New DirectorySearcher(oRoot)
Dim oResults As SearchResultCollection
Try
oSearcher.PropertiesToLoad.Add("cn")
oResults = oSearcher.FindAll
MsgBox(oResults.Count)
Catch e As Exception
MsgBox("Error is [" & e.Message & "]")
End Try