Change Default RDP Port
Steps to Change RDP Port from Registry (regedit)
Type regedit in the Search box
From the left navigation bar follow this path:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Find PortNumber
Right-click Edit, then click Modify, and then click Decimal
Type your new desired port number, and then click OK.
Close the registry editor and restart your server*
* Proceed with server restart only if you are sure there is no Firewall on your server. In any other case, read further below how to whitelist the new RDP port on Windows Firewall.
Allow Custom RDP Port on Windows Firewall
Depending on your Windows Firewall state, you may need to add the new RDP port in the Inbound rules to ensure new connections will be allowed.
Open Windows Firewall on your Server (type firewall in the Search box)
From the left-hand navigation, click Inbound Rules
Click New Rule in the right-hand pane to open the New Inbound Rule Wizard.
In the New Inbound Rule Wizard, under the Rule Type section, select Port and click Next
In the Protocol and Ports section, select TCP. Next, select Specific local ports, enter the custom RDP port as you have set it in Registry and then click Next
In the Action section, select Allow the connection and click Next
In the Profile section, select all appropriate profiles for when this rule applies and click Next
Finally, give your new rule a descriptive name so that it is easy to find later, and click Finish.
Reboot your server if you haven’t done so after the registry changes
Verify New RDP Port with PowerShell
Once your server has been rebooted you should be able to access it with the newly added RDP Port. To verify the newly set RDP port number, open PowerShell and run the following command:
Sample Output:
REFERENCES
Last updated
Was this helpful?