Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 使用注册表查看ICMP类型设置_Windows_Powershell_Registry_Icmp - Fatal编程技术网

Windows 使用注册表查看ICMP类型设置

Windows 使用注册表查看ICMP类型设置,windows,powershell,registry,icmp,Windows,Powershell,Registry,Icmp,我想查看在我的系统上允许/启用哪些ICMP类型 我已经找到了可以设置ICMP的位置,但是否可以在注册表中查看这些设置或通过powershell命令获取这些设置?用于枚举防火墙规则。用于获取有关这些规则筛选内容的详细信息。筛选ICMP协议规则的输出,然后选择ICMP类型 Get-NetFirewallRule -Enabled True -Action Allow | Get-NetFirewallPortFilter | Where-Object { $_.Protocol -i

我想查看在我的系统上允许/启用哪些ICMP类型

我已经找到了可以设置ICMP的位置,但是否可以在注册表中查看这些设置或通过powershell命令获取这些设置?

用于枚举防火墙规则。用于获取有关这些规则筛选内容的详细信息。筛选ICMP协议规则的输出,然后选择ICMP类型

Get-NetFirewallRule -Enabled True -Action Allow |
    Get-NetFirewallPortFilter |
    Where-Object { $_.Protocol -in 'icmpv4', 'icmpv6' } |
    Select-Object -Expand IcmpType -Unique
Allow
替换为
Block
,以枚举阻塞规则

如果
获取NetFirewallRule
找不到规则,它将抛出一个错误。您可以通过向命令中添加
-ErrorAction SilentlyContinue
来抑制这种情况

请注意,
*-NetFirewall*
cmdlet是在Windows Server 2012中引入的,在早期版本中不可用。对于那些需要使用命令的用户。使用类似的方法枚举防火墙规则

netsh advfirewall firewall show rule all

并解析输出以获取相关信息。

这对我帮助很大。非常感谢。您还可以告诉我如何使用
advfirewall
获得与使用
netsh firewall show icmpset
相同的结果吗?正如我所说,您需要解析
netsh advfirewall firewall show rule all
的输出。