Essential config for managing windows PC/Server remotely. Ping and RDP.

Cheeseburger
3 min readJun 5, 2021

To make a windows server or even windows 10 remotely managable, you need to at least enabling the RDP service to access remote connection and allow Ping response to test if the server/host is reachable in the network.

People may prefer using GUI to do that because it is easy. However, it could be extremely time consuming if you need to repeat the same task on multiple server/host, using command line or in short CLI and make your job way more efficient.

If all you want is a quick copy and paste to get the job done, here are the line to copy and run in the administrator powershell.

Set-ItemProperty -Path “HKLM:\System\CurrentControlSet\Control\Terminal Server” -Name “fDenyTSConnections” –Value 0

Enable-NetFirewallRule -DisplayGroup “Remote Desktop”

netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in action=allow

If you want to know the a bit more detail before you run those command, continue the reading.

Here are the key steps

  1. run powershell as administrator
  2. enable remote desktop service using command line
  3. enable firewall rules to allow incoming rdp connection (tcp 3389)
  4. enable incoming icmp ping using command line
  1. Run Windows PowerShell as administrator

As all these changes requires administrator access, make sure you run the powershell as adminsitrator

2. Enable Windows Firewall Rules to allow incoming RDP connection

By default, Windows Defender firewall block the incoming RDP traffic. You need to manually enable to firewall to allow the inbound rules. Or you can simply disable the firewall which is definitely not recommended.

copy and run this line in powershell (run as administrator)

Enable-NetFirewallRule -DisplayGroup “Remote Desktop”

verify the firewall rules are enabled in windows defender firewall

3. Enable Remote Desktop Service

Next Enable the RDP service itself.

Set-ItemProperty -Path “HKLM:\System\CurrentControlSet\Control\Terminal Server” -Name “fDenyTSConnections” –Value 0

4. Enable ICMP echo request (Ping)

Finally and optionally, you can enable ICMP inbound rule because it is again not enabled by default.

netsh advfirewall firewall add rule name=”ICMP Allow incoming V4 echo request” protocol=icmpv4:8,any dir=in action=allow

5. Verify

Try to connect the windows server from other machine using RDP client. If you see the login prompt, you rdp is working.

make a rdp connection to test the service and firewall rules

Try to ping form the other pc to the windows server machine.

ping test result after enabling icmp

I hope this quick guide helps. Thanks for reading.

--

--