修改Windows远程端口(PowerShell)

发布时间 2023-05-22 17:56:33作者: devs
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