Results 1 to 2 of 2

Thread: Get all computer names in network IN c#

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    May 2003
    Location
    india
    Posts
    273

    Get all computer names in network IN c#

    hi all
    anybody workd on how to get all computer names in the network in c#
    i was tring this code , but i am getting error.
    can anybody help in this code or provide working code ..
    using System.DirectoryServices;
    Code:
    string domain = "DomainNAme";  
    ArrayList ALLCPU = new ArrayList();  
    DirectoryEntry de = new DirectoryEntry(domain);
    //Iterate through entries to find the Computer names
    foreach (DirectoryEntry child in de.Children)
    {
    if (child.SchemaClassName == "Computer")
    {
    AllCPU.Add(child.Name);
    // Or whatever else you want to do with them
    }
    }
    help in highly appreciated..

    thanks & reg

    PPCC
    Last edited by Hack; May 19th, 2006 at 05:37 AM. Reason: Added [code] [/code] tags for more clarity.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width