This article will explain how to change remote desktop port in Windows Server 2022. The remote in server 2022 support is made possible by the Remote Desktop Protocol (RDP protocol) with which we reach a range of management within computers without having to go directly to the physical location of the user, this clarifies many tasks support and control for administrators.
By default, the RDP connection port used by Windows Server 2022 is port 3389 and though this may not be applicable, it can become a cause of weakness since an attacker can use the default port to make his connections and cause effects on your server. And in the information hosted there. Therefore, good security advice is to change default port and in this way add a touch of security to the system.
For more information and detailed instructions, you can visit the official Microsoft Documentation on changing the Remote Desktop port in Windows Server 2022:
Change Remote Desktop Port
In the Server Manager, click on local server and check the “Remote Desktop” is enabled.
If not, we must click there and enable it.

Choose “allow remote connections to this computer and click ok.

Open the Registry Editor by entering regedit in run.

In the Registry Editor go to the following path.
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
In this instance, you will need to change the port number that the Remote Desktop service is listening on to 3350. To do this.
Find the name PortNumber. This parameter shows the port, on which your Remote Desktop service is running. Double click on the PortNumber value.

The default port is 3389 (decimal), Change the value of this parameter.

The RDP port is now set to 3350 (Decimal).

How to Allow Remote Desktop Port in Windows Firewall
Search control panel and open it.

In the Control Panel, open Windows defender firewall.

Click on advanced settings.

Click on Inbound rules and then choose new rule.

New inbound rule wizard, select port and click next.

Specify local ports (3350) and click next.

Choose allow the connection of this port and click next.

Specify the profiles for which this rule applies and click ok.

Assign a name to the rule to create and click finish..

Restart Windows Server 2022 to complete the port update process.

Test Remote Desktop Port
On any client computer, we need to test the remote desktop port numer.
Open run and type the command mstsc.

In the remote desktop connection window, enter the IP address of Windows Server 2022 with the port we have assigned earlier and click on connect.

Enter the credentials to use and click ok.

It is an issue associated with the RDP certificates, click Yes to access remotely through the selected port.

We have successfully connected with the port number we changed.



