Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- netsh firewall set icmpsetting 8
- netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request"
- protocol=icmpv4:8,any dir=in action=allow
- # allow-icmp.ps1
- # Sets up windows firewall to allow inbound ICMP - using PowerShell
- # Thomas Lee - tfl@psp.co.uk
- #create firewall manager object
- $FWM=new-object -com hnetcfg.fwmgr
- # Get current profile
- $pro=$fwm.LocalPolicy.CurrentProfile
- # Check Profile
- if ($pro.IcmpSettings.AllowInboundEchoRequest) {
- "Echo Request already allowed"
- } else {
- $pro.icmpsettings.AllowInboundEchoRequest=$true
- }
- # Display ICMP Settings
- "Windows Firewall - current ICMP Settings:"
- "-----------------------------------------"
- $pro.icmpsettings
- netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
- Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv4-In)" -enabled True
- Set-NetFirewallRule -DisplayName "File and Printer Sharing (Echo Request - ICMPv6-In)" -enabled True
Add Comment
Please, Sign In to add comment