habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Easy Change Default Port RDP Remote Dekstop Windows

1 min read

Change Default Port RDP Remote Dekstop Windows

When connect to a computer (either a Windows client or Windows Server) through the Remote Desktop client, by default RDP will listen on port 3389. This Port must open. And now we will custom change default port remote dekstop to other port.

Change via Registry Editor

We 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.

Ok finished. If we implement a windows firewall, please check and add the newly created port number so that it can be accessed from outside.

Other Way, Change Via PowerShell.

You can check the current port by running command below on PowerShell.

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

The Result is :

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
change default port remote dekstop
Powershell Get RDP Port

Change the RDP port by running the following PowerShell command. In this command, we’ll specify the new RDP port as 33890.

To add a new RDP Port to the registry:

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value 33890

New-NetFirewallRule -DisplayName 'RDPPORTLatest' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 33890
  • First line, is set RDP port open in port 33890.
  • Second line, is set firewall allow/open incoming traffic to port 33890.

That is simple tips change default port remote dekstop. May be it’s helpful, please feel free to leave a comment if you have any questions and I’ll appreciate it.

See also  Windows Server 2016/2019 Evaluation Extend the Trial Period

source: microsoft.

habibzain Just husband, father and enthusiastic men about System Administration. Love to write short article about it. Perhaps can help and be useful for others.

Manage Windows Server with Sconfig

“Sconfig” stands for “Server Configuration”, and it is a command-line utility in Windows Server operating systems. It is used to perform basic configuration tasks...
habibzain
48 sec read

How Terminate or End a Running Process in Windows

To terminate or end a running process in Windows, we can use the “Taskkill” command. Here’s how to use it: Open the Command Prompt:...
habibzain
55 sec read

Leave a Reply

Your email address will not be published. Required fields are marked *

Never miss good article from us, get weekly updates in your inbox