修改Windows远程端口(PowerShell)

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp' -name "PortNumber" -Value 33899
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value 33899
New-NetFirewallRule -DisplayName 'RDP Latest Port' -Profile 'Any' -Direction Inbound -Action Allow -Protocol TCP -LocalPort 33899
posted @ 2023-05-22 17:52  devs  阅读(88)  评论(0编辑  收藏  举报