Change RDP Port
Last updated
Last updated
$rdpPort = 3389
$keyPath = "HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp"
Set-ItemProperty -Path $keyPath -Name "PortNumber" -Value $rdpPort -Type DWORD
New-NetFirewallRule -DisplayName "Remote Desktop" -Direction Inbound -Protocol TCP -LocalPort $rdpPort -Action Allow -Enabled True
Restart-Service TermService -Force