eocron06 eocron06 - 1 year ago 82
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
Answer Source

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");
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download