ASP.NET and LDAP : PLEASE HELP!!!!

W

walter

Hi All

I am trying to Authenticate a user from Novell LDAP using the code below. I
can successfully Connect to the LDAP Server, but get the following error
message as soon as I hit the search command:- (a) Server did not send any
data.

Imports System
Imports System.Text
Imports System.Collections
Imports System.DirectoryServices

Public Function AuthenticateUser(ByVal Username As String, ByVal Password As
String) As Collection
Dim dirSearch As New DirectorySearcher
Dim resultSet As SearchResultCollection
Dim result As SearchResult
Dim resultFields() As String = {"SecurityEquals", "cn"}

With dirSearch
.SearchRoot = New DirectoryEntry("server1.com", "username",
"password")
.PropertiesToLoad.AddRange(resultFields)
.Filter = "cn=*"
End With

Try
resultSet = dirSearch.FindAll()
If (resultSet.Count > 0) Then
For Each result In resultSet
'// display results here
Next
Else
'// display error message
End If
Catch ex As Exception
throw ex
Finally
dirSearch = Nothing
End Try
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,071
Latest member
MetabolicSolutionsKeto

Latest Threads

Top