1. log on to the server and use the Regedit command to open the registry;
2. Find the following branch:
HKLM/system/CurrentControlSet/control/Terminal Server/WDS/repwd/tDS/tcp, find the DWORD Value "portnumber" in the right pane, double-click "decimal" in the pop-up dialog box and you will find that the default value is 3389, and change it to the appropriate port. Here we assume that it is changed to 3390;
3. Similar to 2, find
HKLM/system/CurrentControlSet/control/Terminal Server/winstations/RDP-TCP. In the right pane, find the name "portnumber" and make the same modification as above;
4. Modify the terminal connection of the ClientProgram. Because the client uses 3389 to connect to the remote host by default, and now the port on the server is changed, the client is useless and must make the same changes. Open the Client Connection Program and follow the usual method to establish a client connection. Click "file-export" in the menu bar to export the current configuration to a file suffixed with the name of CNS. Open the configuration file in notepad, find a line like "server port = 3389", change 3389 to 3390, save it, and click "File> Import" in the menu bar ", import the modified configuration file again.
Now we can. Restart the system.
Note: In fact, you can only modify the second part. In addition, the second standard connection should be
[HKEY_LOCAL_MACHINE/system/CurrentControlSet/control/Terminal Server/winstations/<connection>
<Connection> indicates a specific RDP-TCP link.
After the restart, check whether the port has been changed.
Tip: When you modify the registry key value, first select hexadecimal, enter the expected port value, and then select hexadecimal. The system will automatically convert the value.