Network and Internet Change Remote Desktop Port in Windows 11


Remote_Desktop_banner.png

This tutorial will show you how to change the Remote Desktop port on your Windows 10 and Windows 11 computer.

You can use Remote Desktop to connect to and control your PC from a remote device by using a Microsoft Remote Desktop client (available for Windows, iOS, macOS and Android). When you allow remote connections to your PC, you can use another device to connect to your PC and have access to all of your apps, files, and network resources as if you were sitting at your desk.

When you connect to a computer (either a Windows client or Windows Server) through the Remote Desktop client, the Remote Desktop feature on your computer "hears" the connection request through a defined listening port (3389 by default). You can change that listening port on Windows computers by modifying the registry.

If you use the Windows Firewall, you will also need to add a new inbound rule to allow traffic on the new port. If you use any other firewall make sure you permit connections to the new port number.


Reference:

You must be signed in as an administrator to change the Remote Desktop port.

Remote Desktop does not support connecting to computers running a Windows Home edition, but you can connect to Pro, Enterprise, and Education editions of Windows from any edition.



EXAMPLE: Current Remote Desktop port

Remote_Desktop_port.png




Here's How:

1 Open Registry Editor (regedit.exe).

2 Navigate to the key below in the left pane of Registry Editor. (see screenshot below)

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp​

Remote_Desktop_port_regedit-1.png

3 In the right pane of the RDP-Tcp key, double click/tap on the PortNumber DWORD to modify it. (see screenshot above)

4 Click/tap on Decimal, type the port number you want to use, and click/tap on OK. (see screenshot below)

The default Remote Desktop port is 3389.


Remote_Desktop_port_regedit-2.png

5 Close Registry Editor.

6 Restart the computer to apply.

If you use the Windows Firewall, you will also need to add a new inbound rule to allow traffic on the new port. If you use any other firewall make sure you permit connections to the new port number.



That's it,
Shawn Brink


 
Last edited:
Home edition of Windows 11 doesn't support Remote Desktop.
 

My Computer My Computer

At a glance

Microsoft Windows 11 HomeIntel Core i5-13490F2 x 16 Patriot Memory (PDP Systems) PSD516G56...GIGABYTE GeForce RTX 4070 WINDFORCE OC 12G (G...
OS
Microsoft Windows 11 Home
Computer type
PC/Desktop
Manufacturer/Model
MSI MS-7D98
CPU
Intel Core i5-13490F
Motherboard
MSI B760 GAMING PLUS WIFI
Memory
2 x 16 Patriot Memory (PDP Systems) PSD516G560081 6400MT (32-37-37-74); 1.35V)
Graphics Card(s)
GIGABYTE GeForce RTX 4070 WINDFORCE OC 12G (GV-N4070WF3OC-12GD)
Sound Card
Bluetooth Аудио
Monitor(s) Displays
INNOCN 15K1F
Screen Resolution
1920 x 1080
Hard Drives
WD_BLACK SN770 250GB
KINGSTON SNV2S1000G (ELFK0S.6)
PSU
Thermaltake Toughpower GF3 1000W
Case
CG560 - DeepCool
Cooling
ID-COOLING SE-224-XTS / 2 x 140Mm Fan - rear and top; 3 x 120Mm - front
Keyboard
Corsair K70 RGB TKL
Mouse
Corsair KATAR PRO XT
Internet Speed
100 Mbps
Browser
Firefox
Antivirus
Microsoft Defender Antivirus
Other Info
https://www.userbenchmark.com/UserRun/66553205
Hi.

After changing the port number in the registry, you also need to update the firewall rules.
It should be mentionned in case people doesn't click on the Microsoft documentation.

Also, method 2: Powershell

Change the registry port number.
Update the existing rules (can't be done via the GUI).
Code:
$PortNumber = 666
Set-ItemProperty -Path 'Registry::HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name 'PortNumber' -Type 'DWord' -Value $PortNumber
Set-NetFirewallRule -Name 'RemoteDesktop-UserMode-In-TCP', 'RemoteDesktop-UserMode-In-UDP' -LocalPort $PortNumber

If you prefer new rules:
Code:
$RuleProperties = @{
    Enabled      = 'False'
    Program      = '%SystemRoot%\system32\svchost.exe'
    Service      = 'TermService'
    Group        = '@FirewallAPI.dll,-28752'
    Action       = 'Allow'
    Direction    = 'Inbound'
    LocalPort    = '666'
}
New-NetFirewallRule -DisplayName 'Custom Remote Desktop - (TCP-In)' -Protocol 'TCP' @RuleProperties
New-NetFirewallRule -DisplayName 'Custom Remote Desktop - (UDP-In)' -Protocol 'UDP' @RuleProperties

When you enable/disable "Remote Desktop" via the GUI, it automatically enable/disable the firewall rules belonging to the "Remote Desktop" group.

If you have created new rules via the GUI, you can add the "Remote Desktop" group to them with:
(It cannot be done via the GUI.)
Code:
Get-NetFirewallRule -DisplayName 'Custom Remote Desktop - (*-In)' | ForEach-Object { $_.Group = '@FirewallAPI.dll,-28752'; $_ | Set-NetFirewallRule }
Adjust the "DisplayName" according to the name you gave to the rules.
 

My Computer My Computer

At a glance

.
OS
.
Back
Top Bottom