eocron06 eocron06 - 3 months ago 25
C# Question

Is there a way to check if RDP connection possible?

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?

Evk Evk

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;


bool available = IsRdpAvailable("your_server_ip_or_name");