How to: Get a list of all computers on the domain
add the following references:
System.DirectoryServices
System.Net
System.Net.NetworkInformation
The following method will return a string list of all the computer names on the domain:
private List<string> GetListOfAllDomainComputers()
{
List<string> domainComputers = new List<string>(30);
try
{
IPGlobalProperties ipgProperties = IPGlobalProperties.GetIPGlobalProperties();
string domain = ipgProperties.DomainName;
DirectoryEntry domainEntry = new DirectoryEntry(“WinNT://” + domain);
domainEntry.Children.SchemaFilter.Add(“computer”);
foreach (DirectoryEntry computer in domainEntry.Children)
domainComputers.Add(computer.Name);
}
catch (Exception x)
{
HandleException(x);
}
return domainComputers;
}
solution found here: source