Reputation: 7526
I have my home server, and want to create manager what will wake up my computer and check if RDP connect now possible.
I accomplished WOL behavior, but now there is problem with checking if computer OS turned on and ready for RDP connections.
Is it possible to 'ping' RDP?
Upvotes: 2
Views: 1386
Reputation: 101463
You can just check if you can connect to RDP port (by default 3389):
static bool IsRdpAvailable(string host) {
try {
using (new TcpClient(host, 3389)) {
return true;
}
}
catch {
return false;
}
}
Usage:
bool available = IsRdpAvailable("your_server_ip_or_name");
Upvotes: 4