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.
# Run the following command: Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp'
Note: 33899 is the RDP port changed in the last step. Please change the parameters according to your settings.
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 a Port in Windows Firewall.
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:33899