Portu Keit

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

https://docs.microsoft.

com/en-us/windows-server/remote/remote-desktop-
services/clients/change-listening-port

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.

1. Start the registry editor. (Type regedit in the Search box.)


2. Navigate to the following registry
subkey: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal
Server\WinStations\RDP-Tcp
3. Find PortNumber
4. Click Edit > Modify, and then click Decimal.
5. Type the new port number, and then click OK.
6. Close the registry editor, and restart your computer.

The next time you connect to this computer by using the Remote Desktop connection, you
must type the new port. If you're using a firewall, make sure to configure your firewall to
permit connections to the new port number.

You can check the current port by running the following PowerShell command:

PowerShellCopy
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal
Server\WinStations\RDP-Tcp' -name "PortNumber"

For example:

PowerShellCopy
PortNumber : 3389
PSPath :
Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
\Terminal Server\WinStations\RDP-Tcp
PSParentPath :
Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
\Terminal Server\WinStations
PSChildName : RDP-Tcp
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry

You can also change the RDP port by running the following PowerShell command. In this
command, we'll specify the new RDP port as 3390.

To add a new RDP Port to the registry:

PowerShellCopy
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal
Server\WinStations\RDP-Tcp' -name "PortNumber" -Value 3390
New-NetFirewallRule -DisplayName 'RDPPORTLatest' -Profile 'Public' -Direction Inbound -
Action Allow -Protocol TCP -

https://www.web24.com.au/tutorials/change-rdp-port-on-a-windows-server

Change RDP port on a Windows Server


Posted on 25 September, 2016

Windows servers are remotely accessible with Remote Desktop via the TCP 3389 port
(default port). In some situations, when a more secure environment is needed, changing
the remote access port can be useful. This article explains how to change the RDP port on
a Windows Hosting Server.

Note: Make sure you have opened remote access to the new RDP port in Windows
Firewall before starting to avoid locking yourself out of the server.

WARNING: Be careful when making changes to the Windows Registry as it contains


critical configuration settings for your operating system.

The instructions below apply to machines running Windows Server 2012, 2008 R2, 2008,
and 2003. Please follow the below steps to change the RDP port:

 1. Connect to the server via Remote Desktop


 2. Click simultaneously on the Windows logo + R to open the “Run” dialog
 3. Open the registry editor by typing the “regedit” command
 4. Search for this registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\TerminalServer\WinStation
s\RDP-Tcp\PortNumber
 5. 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, the selected port is 3312). Click on “OK” to save the selection.
IMPORTANT: Make sure that remote access to your server through the new port is
authorized in your Windows firewall before executing the next step.

 6. Exit the registry editor


 7. Restart your server

After the reboot, specify the Remote Desktop port number. Learn more about
our Windows VPS hosting here.

You might also like