bannerAds

产品

文档

服务与支持

菜单 

国际站

SiliCloud帮助文档中心

搜索

热门搜索词 

Windows 远程桌面 端口修改方法

更新时间 2023-08-04 00:58 版本 v1.6
我要反馈 

适用的Windows版本:

Windows Server 2022, Windows 10, Windows 8.1, Windows 8, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2008 R2

基于软件:

Powershell

正文:

  1. 使用以下命令,查询 目前RDP正在使用的端口号
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber"
  1. 通过以下命令,可以修改RDP 端口号,并增加防火墙放行规则
$portvalue = 33990

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

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

以上,就是本篇的全部内容。

希望对您有帮助。

您对该文档有什么建议?

您对该文档的评分