I have inherited a VB.Net application that can use LDAP, and to do so it
uses Novell.directory.ldap dll. At application logon it checks the LDAP
server for a valid user - so it connects to the server and tries to bind
the user. At this point, I now need to retrieve the user's email address
from the LDAP. I've searched around the Net but can't see how to do
this. Could someone kindly point me in the right direction, please? This
is not using eDirectory.

Code so far is (more or less):
Dim conn As New Novell.Directory.Ldap.LdapConnection()
conn.Connect(server, port)
conn.Bind(bindUser, bindPassword)
Dim searchString As String = String.Format("CN={0},{1}", userName,
Dim sResults As LdapSearchResults = conn.Search(searchString,
Novell.Directory.Ldap.LdapConnection.SCOPE_SUB, Nothing, Nothing,
Dim userDN As String = sResults.next.DN
conn.Bind(userDN, password)

I guess at this point I should be able to get at their email address...


BeachcomberSoftware's Profile: https://forums.netiq.com/member.php?userid=4136
View this thread: https://forums.netiq.com/showthread.php?t=46651