When you connect to a computer (a Windows client or Windows Server) through the Remote Desktop client, the Remote Desktop feature on your computer “hears” the connection request. Your computer hears IT through a defined listening port (3389 by default). Moreover, you can change that listening port on Windows computers by modifying the registry.
To change the port that Remote Desktop listens on, follow the below steps –
These are the steps you can take to modify your registry. Make sure you properly modify the registry, as anything goes wrong, it may cause problems. Backup the registry before changing it for safety.
Start the Registry Editor.
Locate and click the following registry sub-key –
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber
Go to the Edit menu, click Modify and then click Decimal.
Enter the new port number and click OK.
Exit the Registry Editor.
Restart your machine.
Note: It is important to type the new port number when you try to connect to this computer with the Remote Desktop Connection. Before connecting this device you will need to set your firewall to allow the fresh port number with the Remote Desktop connection.