Windows Server change Remote Desktop port PowerShell

Tutorials thread

Windows Server change Remote Desktop port PowerShell

Postby serveroffer » 2022 Jan 30, 21:16

You can change Remote Desktop port on your Windows Server machine by running PowerShell commands listed below:

Code: Select all
$portvalue = 3388

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

New-NetFirewallRule -DisplayName 'RDPNEW-TCP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort $portvalue
New-NetFirewallRule -DisplayName 'RDPNEW-UDP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol UDP -LocalPort $portvalue

After reboot connect using Remote Desktop client ServerIP:3388
If you are using Remote Desktop Manger, you need set port on connection properties [Connection Settings]

Note: some internet providers might block Remote Desktop connection if port is changed.
User avatar
Site Admin
Posts: 45
Joined: 2012 Jun 16, 18:31

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest