I usually only participate in the C/C++ forum but i guess desperate times need desperate measures.
Well, i am trying to query an LDAP through DirectoryServices but can't seem to get it right and need ur help in the matter.
Here's the code i am using..
strUID = Request.ServerVariables("HTTP_UID") Dim Entry As System.DirectoryServices.DirectoryEntry Entry = New DirectoryEntry[URL]ldap://myserver:401/ou=people,o=org[/URL], "uid=myid,o=org", "pwd123") Dim Search As DirectorySearcher = New DirectorySearcher(Entry) Search.Filter = "(micid=" & strUID & ")" Search.PropertiesToLoad.Add("givenname") Search.PropertiesToLoad.Add("sn") Search.PropertiesToLoad.Add("telephoneNumber") Search.PropertiesToLoad.Add("mail") Dim Results As SearchResult = Search.FindOne() strfname = Results.Properties("givenname")(0).ToString()
The error i am getting is :
The parameter is incorrect.
I got a hunch that the user id i am using i.e uid=myid,o=org
is the cause of the problem as the server is taking it as more than one parameter.
But don't know how to fix it..
Can anybody help..??
Thanks a lot..