title: How to retrieve all users of Active Directory?
body: <p>I use following code to retrieve <code>all</code> users of active directory but <code>not all users</code> retrieved. Should I include something else in <code>Filter</code>?
   this is simplified code.</p>
  
  <pre><code>DirectoryEntry entry = new DirectoryEntry("LDAP://" + Bous.DomainName, Bous.UserName, Bous.Password);
  DirectorySearcher mySearcher = new DirectorySearcher(entry);
  mySearcher.Filter = ("(&amp;(objectCategory=person)(objectClass=user))");
  
  foreach (SearchResult result in mySearcher.FindAll())
  {
       dr = dt.NewRow();
       ResultPropertyCollection myResultPropColl = result.Properties;
       dr[0] = myResultPropColl["samaccountname"][0].ToString() + "@" + Bous.DomainName;
       dt.Rows.Add(dr);
  }        
  </code></pre>