Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
Thread: Error querying LDAP
03-08-2007, 03:30 AM #1
- Join Date
- Oct 2006
- Thanked 0 Times in 0 Posts
Error querying LDAP
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 DirectoryEntryldap://myserver:401/ou=people,o=org, "uid=myid,o=org", "pwd123")
Dim Search As DirectorySearcher = New DirectorySearcher(Entry)
Search.Filter = "(micid=" & strUID & ")"
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..
"Have no fear of perfection, you'll never reach it"