title: Searching specific folder, Active Directory
body: <p>I am trying to access the names of all users in a specific folder, and i cannot find out how to do this. So far I can only search the entire active directory and limit my filter options but this is not enough. This is what I have so far: </p>
  
  <pre><code>DirectoryEntry dir = new DirectoryEntry("LDAP://path.local", "username", "password");
  string filter = "(&amp;(objectCategory=person)(objectClass=user);(!userAccountControl:1.2.840.113556.1.4.803:=2)(c=CA))";
  string[] propertiesToLoad = new string[1] { "name" };
  DirectorySearcher searcher = new DirectorySearcher(dir, filter, propertiesToLoad);
  SearchResultCollection results = searcher.FindAll();
  List&lt;string&gt; usernames   = new List&lt;string&gt;();
  foreach (SearchResult result in results)
          {
              string name = (string)result.Properties["name"][0];
              if (name != null)
                  usernames.Add(name);
          }
  </code></pre>
  
  <p>How would i go about searching for a specific file in  the active directory, say if the path was  Buisness\Canada\Users?</p>