1

We have a server 2008 r2 virtual machine that's acting as a public facing RDP terminal (I know I know, that's a whole different fight). I'm trying to set RDP to use any port but 3389, but I get the "this computer is unavailable" message whenever I change the port. What I'm doing is:

1) Changing the port used by RDP in the registry (HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > Terminal Server > WinStations > RDP-Tcp > PortNumber field)

2) Changing the symantec firewall rule that allows traffic on port 3389 to port (for example) 4000. (Windows firewall is disabled, and I've made sure the service isn't running in services.msc)

3) Try to open an RDP session from another computer on the LAN to x.x.x.x:4000

When I use netstat -a it says TCP is listening on port 4000, but RDP connections fail with the "the computer is offline error". When I do the exact steps as above with 3389 it works, anyone know what's up?

4 Answers4

0

First, ensure you have entered the value in Decimal format, NOT in hexadecimal format.

Second, you will have to restart the Remote Desktop Service service after changing the RDP port in the registry.

You can easily change the RDP port through PowerShell. Open PowerShell and run the following command.

$portvalue = 4000

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $portvalue

Stanley
  • 156
0

I would recommend to try to do using PowerShell (you can change the 50102 to the desired port number)

Set-ItemProperty -Path "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\" -Name PortNumber -Value 50102

New-NetFirewallRule -DisplayName "Custom RDP Port (TCP-In)" -Direction Inbound -LocalPort 50102 -Protocol TCP -Action Allow New-NetFirewallRule -DisplayName "Custom RDP Port (UDP-In)" -Direction Inbound -LocalPort 50102 -Protocol UDP -Action Allow

The two commands adjust the Windows Defender firewall to allow your new custom RDP port (not sure if these work on w2k8)

Ace
  • 812
0

(Windows firewall is disabled, and I've made sure the service isn't running in services.msc)

No, no, NO, NO.

The proper way to disable Windows Firewall is to configure it to be "Off" on all network profiles, but you should never actually stop and disable the Windows Firewall service, which is an integral part of the Windows networking stack.

Stopping the actual service is not supported and can lead to any sort of networking issues, regardless of whatever traffic you wanted to allow or deny.

See also here: How can I back up my recommendation to NOT disable the Windows Firewall service?

Massimo
  • 72,827
0

Export the registry from the working one and import into the broken one

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

Patrick Mevzek
  • 10,581
  • 7
  • 35
  • 45