As we know windows servers are remotely accessible with Remote Desktop via TCP default port 3389. In some cases, as when we wish to  more secure atmosphere on our server, changing the remote access port can be useful.

To change the port of Remote Desktop follow these steps:

Connect to your server via Remote Desktop

1.Click simultaneously on the Windows logo + R to open the “Run” dialog and open registry editor by typing“regedit” command.

2.Search for this registry subkey:

 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

3.  On the Edit menu, click Modify, and select the decimal base and type the port number of your choice Click on“Ok” to save your selection.
4.  Exit the registry editor.
5.  Restart your server.

IMPORTANT: Make sure that remote access to your server through the new port is authorized in your Windows firewall before executing the next step. When you try to connect to this computer by using the Remote Desktop connection, you must type the new port.