I am using ip address to find the active state of the machine
System.Net.NetworkInformation.Ping p = new System.Net.NetworkInformation.Ping();
System.Net.NetworkInformation.PingReply rep = p.Send(ip);
if (rep.Status == System.Net.NetworkInformation.IPStatus.Success)
You could use this code to check the status..and also explore this site you could get some idea…System.Net.NetworkInformation Namespace