我想使用PowerShell 组策略管理编辑器 -> domain.local -> 组策略对象 -> MyGpo -> 计算机配置 -> Windows SettingsE 211 -> -> Security SettingsE 213->>E 114“具有高级安全性的Windows防御防火墙-LDAP:.”E 215设置
-DefaultInboundAction块-DefaultOutboundAction允许-NotifyOnListen真-AllowUnicastResponseToMulticast真

但我找不到正确的命令。我在用
Set-NetFirewallProfile -PolicyStore "universitetas.local\Group Policy Objects\BazinėsUgniasienėsTaisyklės" -DefaultInboundAction Block -DefaultOutboundAction Allow –NotifyOnListen True -AllowUnicastResponseToMulticast True -Enabled True但这给了我一个错误..。
Set-NetFirewallProfile : The parameter is incorrect.
At C:\Users\Administrator\Desktop\sukonfiguruotiFirewalla.ps1:42 char:1
+ Set-NetFirewallProfile -PolicyStore "universitetas.local\Group Policy ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (MSFT_NetFirewallProfile:root/standardci...FirewallProfile) [Set-NetFirewallProfile], CimException
+ FullyQualifiedErrorId : Windows System Error 87,Set-NetFirewallProfile我很确定我的命令几乎是正确的,但它缺少一些东西。
发布于 2022-04-02 13:36:52
感谢提供的建议。如果其他社区成员将来遇到同样的问题,可以将其转化为一个帮助他们的答案。
如果我尝试使用您的代码,我也会得到相同的错误。您需要使用hyphen来代替en-dash。
您将注意到将en-dash和hyphen写在NotePad上的不同之处。

参考:
https://stackoverflow.com/questions/71631867
复制相似问题