On the local computer inside the network, (the computer that is going to be accessed from outside using RDP), open the “Run” dialog box and execute the “cmd” command. Once the cmd dialog box comes up, Open the registry editor by typing the “regedit” command and press enter.

In registry editor, Search for this registry subkey: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp\PortNumber

Double-click or right-click on the “PortNumber” registry subkey, select the decimal base and type the port number of your choice (the default port is 3389, in this example, we selected port 3392). Click on “Ok” to save your selection.

For changes to take effect, computer has to be restarted.