Hi All,<BR>I have an ASP.NET application that needs to look at Active Directory to get user names and e-mail accounts. The way I do it is to supply the following commands :<BR><BR><BR>Public Function GetADItem(ByVal SamAccount As String, ByVal Item As String) As String<BR><BR>Dim sPath As String = "LDAP://xxxx/DC=xx,DC=xxx,DC=xxx,DC=xxx"<BR>Dim myDirectory As New DirectoryEntry(sPath, "uname", "password") &#039;pass the user account and password for your Enterprise admin.<BR>Dim mySearcher As New DirectorySearcher(myDirectory)<BR>Dim mySearchResultColl As SearchResultCollection<BR>Dim mySearchResult As SearchResult<BR>Dim myResultPropColl As ResultPropertyCollection<BR>Dim myResultPropValueColl As ResultPropertyValueCollection<BR><BR>Try<BR> &#039;Build LDAP query<BR> mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" & SamAccount & "))")<BR> mySearchResult = mySearcher.FindOne()<BR><BR> &#039;Get the Properites, they contain the usefull info<BR> myResultPropColl = mySearchResult.Properties<BR><BR> &#039;Retrieve from the properties collection the display name and email of the user<BR><BR> myResultPropValueColl = myResultPropColl.Item(Item)<BR> Return CStr(myResultPropValueColl.Item(0))<BR>Catch e As Exception<BR> Return "Active Directory Error"<BR>End Try<BR><BR>End Function<BR><BR>.<BR>.<BR>.<BR><BR>Now this works but it is not very secure because I have to supply a username and password which has access to Active Directory.<BR><BR>Does anyone have a better solution ?<BR><BR>Many Thanks