Re: ldap connection problem

Tech-Archive recommends: Fix windows errors by optimizing your registry



On Tue, 2 Aug 2005 06:11:05 -0700, "Amar" <Amar@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

¤ I am trying to connect to my college LDAP directory using ASP.NET. This LDap
¤ does not have security as it returns only user demographic information.
¤ i do not need to bind with a username or credentials.
¤ What i am trying to do is, i am trying to look up all the information for
¤ the user with user id 'testuser'. The following is the Vb.net code for my
¤ aspx page:
¤
¤ Dim oRoot As DirectoryEntry = New
¤ DirectoryEntry("LDAP://directory.x.y/ou=People,dc=x,dc=y";)
¤ Dim oSearcher As DirectorySearcher = New DirectorySearcher(oRoot)
¤ Dim oResult As SearchResult
¤ Dim propName As String
¤ Dim obProp As Object
¤
¤ Try
¤ oSearcher.Filter = "uupid=testuser"
¤ oResult = oSearcher.FindOne
¤ For Each propName In oResult.Properties.PropertyNames
¤ For Each obProp In oResult.Properties(propName)
¤ Response.Write("name= " & propName)
¤ Response.Write("value= " & obProp)
¤ Next
¤ Next
¤ Catch Ex as Exception
¤ End Try
¤
¤ The above code fails at the line "oResult = oSearcher.FindOne" and gives me
¤ an error which is useless: "Unknown error (0x80005000)"
¤ I have already posted this question twice. Is there nobody whos faced this
¤ problem?
¤ Please help me!! Thanks in advance.

Sounds like it might be a credentials issue. What level of security is set for your web application
in IIS? Are you implementing impersonation?


Paul
~~~~
Microsoft MVP (Visual Basic)
.



Relevant Pages