I am using the following code to obtain all computers in my domain.
This returns all computers ever created in the domain. I would like to
only get currently active computers. Sort of like when you go into
Server Manager and it displays an active icon next to the computer
indicating that it is logged into the domain. Any help would be
appreciated.
private DirectoryEntry deDOMAIN = new
DirectoryEntry("WinNT://MYDOMAIN");
DirectoryEntries _myDcn = deDOMAIN.Children;
foreach(DirectoryEntry d in _myDcn)
{
if (d.SchemaClassName == "Computer")
treeView1.Nodes[0].Nodes.Add(new TreeNode(d.Name));
}