无法通过 powershell 更改“RemoteDesktop-UserMode-In-TCP”防火墙规则的描述

无法通过 powershell 更改“RemoteDesktop-UserMode-In-TCP”防火墙规则的描述

我正在尝试更改 Windows Server 2019 Core 的 RDP 端口。我已成功编辑注册表,并能够更新防火墙规则中的端口,以便一切正常:

PS C:\Windows\system32> Get-NetFirewallRule -Name "RemoteDesktop-UserMode-In-TCP" | Get-NetFirewallPortFilter


Protocol      : TCP
LocalPort     : 3355
RemotePort    : Any
IcmpType      : Any
DynamicTarget : Any



PS C:\Windows\system32> Get-NetFirewallRule -Name "RemoteDesktop-UserMode-In-TCP"


Name                  : RemoteDesktop-UserMode-In-TCP
DisplayName           : Remote Desktop - User Mode (TCP-In)
Description           : Inbound rule for the Remote Desktop service to allow RDP traffic. [TCP 3389]
DisplayGroup          : Remote Desktop
Group                 : @FirewallAPI.dll,-28752
Enabled               : True
Profile               : Any
Platform              : {}
Direction             : Inbound
Action                : Allow
EdgeTraversalPolicy   : Block
LooseSourceMapping    : False
LocalOnlyMapping      : False
Owner                 :
PrimaryStatus         : OK
Status                : The rule was parsed successfully from the store. (65536)
EnforcementStatus     : NotApplicable
PolicyStoreSource     : PersistentStore
PolicyStoreSourceType : Local


现在,为了更清楚起见,我尝试相应地改变规则Description

PS C:\Windows\system32> Set-NetFirewallRule -Name "RemoteDesktop-UserMode-In-TCP" -Description "Inbound rule for the Remote Desktop service to allow RDP traffic. [TCP 3355]"

输出为空,并且该命令显然不起作用:

PS C:\Windows\system32> Get-NetFirewallRule -Name "RemoteDesktop-UserMode-In-TCP"


Name                  : RemoteDesktop-UserMode-In-TCP
DisplayName           : Remote Desktop - User Mode (TCP-In)
Description           : Inbound rule for the Remote Desktop service to allow RDP traffic. [TCP 3389]
DisplayGroup          : Remote Desktop
Group                 : @FirewallAPI.dll,-28752
Enabled               : True
Profile               : Any
Platform              : {}
Direction             : Inbound
Action                : Allow
EdgeTraversalPolicy   : Block
LooseSourceMapping    : False
LocalOnlyMapping      : False
Owner                 :
PrimaryStatus         : OK
Status                : The rule was parsed successfully from the store. (65536)
EnforcementStatus     : NotApplicable
PolicyStoreSource     : PersistentStore
PolicyStoreSourceType : Local

更改手动创建的规则的描述有效。

原因是什么?或者我该如何解决?我是否应该将这些规则复制到新规则中,修复其描述并禁用这些旧规则?

相关内容