I am not sure if anyone has worked with LDAP or Active Directory queries but I thought I couldn&#039;t hurt to ask. The below code will get all users sam account from my network but takes way to long, if anyone could help me speed this query up I would greatly appreciate it.<BR><BR>Imports System<BR>Imports System.Data.SqlClient<BR>Imports System.Security.Principal<BR>Imports System.DirectoryServices<BR>Imports System.Web<BR>Imports System.Diagnostics<BR><BR>Public Class ActiveDirectory<BR> Inherits System.Web.UI.Page<BR><BR> Dim sUsers As String<BR> Public Function GetUserInfo() As String<BR><BR> Dim oDirectory As New DirectoryEntry("LDAP://MyServer", "Domain Admin", "Password")<BR><BR> Dim mySearcher As New DirectorySearcher(oDirectory)<BR> Dim oDirEntry As DirectoryEntry<BR> Dim oPropNames As ICollection<BR> Dim oProperties As DirectoryServices.PropertyCollection<BR> Dim oPropValues As PropertyValueCollection<BR> Dim oResult As SearchResult<BR> Dim sPropName As String<BR> mySearcher.SearchScope = SearchScope.Subtree<BR> mySearcher.ReferralChasing = ReferralChasingOption.All<BR> mySearcher.Filter = "(&(objectclass=user)(objectcategory=person))"<BR> <BR> For Each oResult In mySearcher.FindAll()<BR> oDirEntry = oResult.GetDirectoryEntry<BR> Debug.WriteLine(oDirEntry.Path)<BR> oProperties = oDirEntry.Properties<BR> oPropValues = oProperties("sAMAccountName")<BR> sUsers = oPropValues.Value<BR> Me.SamAccount.Text = sUsers<BR> Next<BR> End Function<BR><BR> Public Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<BR><BR> GetUserInfo()<BR><BR> End Sub<BR><BR>End Class<BR><BR>