LDAP Search

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Good Day Folks,

I'm trying to do an LDAP search of Novell eDirectory, but I'm getting a
compile error.
The error and my code are listed below.

Any ideas ?
Thanks in advance
/Serge


Compile error message
---------------------------
'System.DirectoryServices.SearchResult.Private Sub New(parentCredentials As
System.Net.NetworkCredential, parentAuthenticationType As
System.DirectoryServices.AuthenticationTypes)' is not accessible in this
context because it is 'Private'.


My code
---------
<%@ Page Language="vb" AutoEventWireup="false"
CompilerOptions='/R:"C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\system.directoryservices.dll"' Debug="true" %>

<%@ Import Namespace="System.DirectoryServices" %>

<html>
<head>
<title></title>
</head>
<body>

<%

Const ADConnectionString As String =
"LDAP://grnbds2.ocdsb.edu.on.ca/ou=GREENBANK, ou=DIST5, o=OCDSB"

Dim oConnection As New DirectoryEntry(ADConnectionString)
Dim oSearcher As New DirectorySearcher(oConnection)
Dim oSearchResults As SearchResultCollection()
Dim oSearchResult As New SearchResult ' this is the line with the error.

oSearcher.Filter = "(objectClass=user)"
oSearchResults = oSearcher.FindAll()

For Each oSearchResult In oSearchResults
Response.write(oSearchResult.Properties("name").ToString & "<br />")
Next

%>
</body>
</html>

--
 
Hi Dear Serge,

Try Declaring the

Dim oSearchResult As New SearchResult ' this is the line with the error.

AS

Public oSearchResult as oSearchResult

oSearchResult = New SearchResult

Declare this above the Page_Load Event ie immediately after the Class
Decleration

and do it everything in the code behind Let Us See

for futher info


http://www.novell.com/products/edirectory/

http://www.novell.com/coolsolutions/edirectory/

and also you can have a look at how to work on Active Directory where
Microsoft gives LDAP services through AD.

and try to do like that only for Novell (edirectory) also.


How to authenticate against the Active Directory by using forms
authentication and Visual Basic .NET
=====================================================
http://support.microsoft.com/default.aspx?scid=kb;en-us;326340

How to authenticate against the Active Directory by using Forms
authentication and Visual C# .NET
=====================================================
http://support.microsoft.com/default.aspx?scid=kb;en-us;316748

Bye
Venkat_KL
 
Back
Top