I’ve got a few talks coming up so need to build some more demo machines. One thing I like to be able to do in the demo environment is ping between machines – sometimes necessary when testing things out but ping is disabled by the Windows firewall in Windows 2008 & R2.
James O’Neill has blogged about working with the Windows firewall at http://blogs.technet.com/jamesone/archive/2009/02/18/how-to-manage-the-windows-firewall-settings-with-powershell.aspx
To just set ping on
001
002 003 004 005 006 007 008 009 |
$fw = New-Object -ComObject HNetCfg.FWPolicy2
#$fw.Rules | Format-Table Name, Enabled, Direction -AutoSize $fw.Rules | where {$_.Name -like "File and Printer Sharing (Echo Request – ICMPv4-In)"} | $fw.Rules | where {$_.Name -like "File and Printer Sharing (Echo Request – ICMPv4-In)"} | |
Use the HNetCfg.FWPolicy2 COM object and enable the rules for "File and Printer Sharing (Echo Request – ICMPv4-In)". There are similar rules for IPv6 if needed. Blocking pings is just the opposite.