Mike the small snippet should return the username and email address
if you play with you should get to what you want
Also make sure you import "Imports System.DirectoryServices"
Dim rootEntry As New DirectoryEntry("LDAP://yourdomain/DC=yourdomain,
DC=com, DC=au", "yourusernameforActivedirectory", "password")
Dim Mysearcher As New DirectorySearcher(rootEntry)
Mysearcher.PropertiesToLoad.Add("cn")
Mysearcher.PropertiesToLoad.Add("mail")
'searcher.PropertiesToLoad.AddRange(New String() {"cn", "mail"})
'would also work and saves you some code
Mysearcher.Filter = "(&(anr=yourusername)(objectCategory=person))"
Dim Myresults As SearchResultCollection
Myresults = Mysearcher.FindAll()
Dim result As SearchResult
For Each result In Myresults
Response.Write("name=" + result.Properties("cn")(0) + "<br>E-mail=" +
result.Properties("mail")(0) + "<br>")
Next
Hope that helps
Patrick
"Mike Harris" <mi*********@cowetaschools.org> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I would like to provide links to email addresses from my website via
ASP.net. Our email addresses are stored in Exchange 2000 so I would have
to query my AD database. Does anyone have any code samples detailing how
this can be accomplished? I would like for the website users to be able to
click on a letter of the alphabet, such as the letter "a" and have a list of all
email addresses that begin with "a" returned in a datagrid. Thanks,
Mike