PPCC
May 19th, 2006, 02:20 AM
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;
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
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;
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