enumeration - Why does enumerating DirectoryEntry children only return 20 results on a WinNT domain? C# -


i'm using following code find computers in given winnt domain, since directorysearcher not supported on winnt domains;

protected void scandomain(string domainname, bool islocaldomain) {     directoryentry parententry = new directoryentry();      if(islocaldomain)     {         try         {             parententry.path = "winnt://" + domainname;              int numresults = 0;             foreach (directoryentry childentry in parententry.children)             {                 switch (childentry.schemaclassname)                 {                     case "computer":                         debug.writeline(childentry.name);                          numresults++;                         break;                 }             }              if (numresults == 0)             {                 debug.writeline("no results.");             }         }         catch (exception ex)         {             debug.writeline("failed.");         }     }     else     {         //...     } } 

but when using method, receive 20 computer results though know there's more computers in domain.

so wondering if had idea why is?

directory entry returns children of specific node. not contain node under nodes, means grand children of that. try check grand children also, , every node under win nt work.

please let me know if want code snippet. or missing thing side.


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -