官网更改方式
https://docs.microsoft.com/zh-cn/windows-server/remote/remote-desktop-services/clients/change-listening-port
查看指令
Get-ItemProperty -Path 'HKLM:SYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp' -name "PortNumber"
更改指令
Set-ItemProperty -Path 'HKLM:SYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp' -name "PortNumber" -Value 3390 New-NetFirewallRule -DisplayName 'RDPPORTLatest' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 3390
#########################网络搜索到的更改方式############
1.打开注册表
regedit
2.找到
计算机HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWds dpwdTds cp
把PortNumber的3389换成指定端口号
3找到
计算机HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminal ServerWinStationsRDP-Tcp
把PortNumber的3389换成指定端口号
4.重启