Introduction
The default Remote Desktop Protocol (RDP) port for Windows servers is 3389. This article introduces the steps to change the RDP port for a Windows server.
1 Change the RDP port on registry
1.1 Change the RDP port by modifying the registry manually
Press “Windows + R” to open Windows Run dialog. Type “regedit” in the Run box and press Enter to open Windows Registry Editor.
Navigate to the following registry subkey: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber
Click Edit > Modify, and then click Decimal. Type the new port number, and then click OK.
Note: The recommended range for RDP ports is 1024-65535.
1.2 Change the registry with PowerShell Command
Open Windows PowerShell (Type PowerShell in the Search box).
Run the following command:
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name 'portnumber' -Value 33899
2 Open the new RDP port in Windows Firewall
The newly set RDP port must be open in the firewall before it can be used.
About how to open a port in Windows Firewall, please refer to How to Open Port in Windows Firewall.
3 Restart the RDP service
3.1Type services in the Search box. Open Services
3.2 Restart Remote Desktop Services
4 Test
Test the connection to the server with the new RDP port.
Note:
You need to fill in "IP:port” in the Computer column. For example: 10.10.XX.XX:338993