Hi
I have the following code:
Please could someone complete the above Response.Write with the property that contains the users email
Thanks very much
David
I have the following code:
Code:
Dim dsDirectoryEntry As DirectoryEntry
Dim dsSearch as DirectorySearcher
Dim result As SearchResultCollection
Dim result1 As SearchResult
Dim aName As String = "David"
dsDirectoryEntry = New DirectoryEntry(LDAPconnstring)
dsSearch = New DirectorySearcher(dsDirectoryEntry)
With dsSearch
.Filter = "(samAccountName=" & aName &")"
.PropertyNamesOnly = True
.PropertiesToLoad.Add("mail")
result = .FindAll()
End With
If result.count = 1 Then
Response.Write("the email for " & aName & " is " & [COLOR=red]email address [/color]
End If
Thanks very much
David