title: get computer from OU
body: <p>I have a code to get a list of all the computers within a domain.</p>
  
  <p>Now i need to just get the computers which are within a particular OU and not the rest of the machines.</p>
  
  <p>so here is my code to get all the machines from a domain, this works perfectly fine:</p>
  
  <pre><code>DirectoryEntry entry = new DirectoryEntry("LDAP://" + selectDomain);
          DirectorySearcher mySearcher = new DirectorySearcher(entry);
          mySearcher.Filter = ("(objectClass=computer)");
          mySearcher.SizeLimit = int.MaxValue;
          mySearcher.PageSize = int.MaxValue;
  
          foreach (SearchResult resEnt in mySearcher.FindAll())
          {
              //"CN=SGSVG007DC"
              string ComputerName = resEnt.GetDirectoryEntry().Name;
              if (ComputerName.StartsWith("CN="))
                  ComputerName = ComputerName.Remove(0, "CN=".Length);
              compList.Add(ComputerName);
          }
  
          mySearcher.Dispose();
          entry.Dispose();
  </code></pre>
  
  <p>any suggestions?? thanks.</p>