How get list of local network computers?

You will need to use the System.DirectoryServices namespace and try the following:

DirectoryEntry root = new DirectoryEntry("WinNT:");

foreach (DirectoryEntry computers in root.Children)
{
    foreach (DirectoryEntry computer in computers.Children)
    {
        if (computer.Name != "Schema")
        {
             textBox1.Text += computer.Name + "\r\n";
        }
    }
}

It worked for me.

Leave a Comment