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
Re: Get all computer names in network IN c#
What error message are you getting and what line of code is it on?