Make sure that the firewall is allowed to access the port after the port is changed.
First open the Registry: Run-Regedit:
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server \ WDS \ repwd \ TDS \ portnumber of the TCP Key is the port used, the default value is 3389 (decimal ), you can change it to another port, such as 3111, to improve security performance.
HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ terminalserver \ winstations \ RDP-TCP find portnumber value on the right, default is 3389, select decimal, change to the port number you want (range: 1024 to 65535, it cannot conflict with the occupied port; otherwise, the system cannot be started next time. Run the netstat-a command to check the port that is already in use on the local machine. Note that the modified port numbers must be consistent.
After modifying the port, when logging on to the Remote Desktop, you must specify a new port after entering the IP address, such: