{"id":17871,"date":"2010-07-03T00:01:00","date_gmt":"2010-07-03T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2010\/07\/03\/hey-scripting-guy-weekend-scripter-how-to-retrieve-enabled-windows-firewall-rules\/"},"modified":"2010-07-03T00:01:00","modified_gmt":"2010-07-03T00:01:00","slug":"hey-scripting-guy-weekend-scripter-how-to-retrieve-enabled-windows-firewall-rules","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/hey-scripting-guy-weekend-scripter-how-to-retrieve-enabled-windows-firewall-rules\/","title":{"rendered":"Hey, Scripting Guy! Weekend Scripter: How to Retrieve Enabled Windows Firewall Rules"},"content":{"rendered":"<p>&nbsp;\nMicrosoft Scripting Guy Ed Wilson here. The Scripting Wife and I are getting ready to head up to the mountains in search of a bit of cool air. Even if it is hot up there, it will still be cool because we are meeting one of my old high school friends. Actually, all of my high school friends are old now, but that is another story. John was in one of my rock bands when we were in high school together. In fact, I taught him how to play the bass guitar. Now he is a microbiologist, and he is bringing his wife and daughter with him. It should be a nice weekend.\nWhile the Scripting Wife is packing, I thought I would work on a script that retrieves <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/aa366453(v=VS.85).aspx\">Windows Firewall<\/a> rules that are enabled on my laptop. Maybe it is because my friend John is a microbiologist and he works with viruses that the thought of working with the firewall jumped into my head.\nThe Windows Firewall is documented on MSDN, but many of the items of concern to people writing in <a href=\"http:\/\/technet.microsoft.com\/en-us\/scriptcenter\/powershell.aspx\">Windows PowerShell<\/a> are not documented. This is not a problem. Using Windows PowerShell, we can discover much of the information that is needed. After the <strong>hnetcfg.fwpolicy2<\/strong> COM object is created and stored in the <strong>$fw<\/strong> variable, its members can be explored by the <strong>Get-Member<\/strong> cmdlet. This is shown here:\n&nbsp;<\/p>\n<div class=\"code\"><span style=\"color: #2b91af\">$fw<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #0000ff\">New-Object<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">-ComObject<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">hnetcfg.fwpolicy2<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #2b91af\">$fw<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">|<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #0000ff\">Get-Member<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">TypeName:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">System.__ComObject<\/span><span style=\"color: #0000ff\">#<\/span><span style=\"color: #000000\">{98325047-c671-4174-8d81-defcd3f03186}<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Name<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">MemberType<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Definition<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">&#8212;-<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">&#8212;&#8212;&#8212;-<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">&#8212;&#8212;&#8212;-<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">EnableRuleGroup<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Method<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">void<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">EnableRuleGroup<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(int,<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">string,<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">bool)<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">IsRuleGroupEnabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Method<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">bool<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">IsRuleGroupEnabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(int,<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">string)<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">RestoreLocalFirewallDefaults<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Method<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">void<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">RestoreLocalFirewallDefaults<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">()<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">BlockAllInboundTraffic<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">bool<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">BlockAllInboundTraffic<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(NET_FW_PROFI&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">DefaultInboundAction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">NET_FW_ACTION_<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">DefaultInboundAction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(NET_&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">DefaultOutboundAction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">NET_FW_ACTION_<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">DefaultOutboundAction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(NET&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">ExcludedInterfaces<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Variant<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ExcludedInterfaces<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(NET_FW_PROFIL&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">FirewallEnabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">bool<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">FirewallEnabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(NET_FW_PROFILE_TYPE&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">IsRuleGroupCurrentlyEnabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">bool<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">IsRuleGroupCurrentlyEnabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(string)&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">NotificationsDisabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">bool<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">NotificationsDisabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(NET_FW_PROFIL&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">UnicastResponsesToMulticastBroadcastDisabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ParameterizedProperty<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">bool<\/span><span style=\"color: #000000\">&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">CurrentProfileTypes<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Property<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">int<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">CurrentProfileTypes<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">()<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">{get}<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">LocalPolicyModifyState<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Property<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">NET_FW_MODIFY_STATE_<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">LocalPolicyModifySta&#8230;<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Rules<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Property<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">INetFwRules<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Rules<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">()<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">{get}<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">ServiceRestriction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Property<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">INetFwServiceRestriction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">ServiceRestricti&#8230;<\/span>&nbsp;&nbsp;<\/div>\n<p>To retrieve the rules, all I need to do is query the <strong>Rules<\/strong> property. This is shown here:\n<span style=\"color: #0000ff\">PS<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">C:Usersed.NWTRADERS&gt;<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #2b91af\">$fw<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #0000ff\">New-Object<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">-ComObject<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">hnetcfg.fwpolicy2<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #2b91af\">$fw<\/span><span style=\"color: #000000\">.rules<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Name<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Zune<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Network<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Sharing<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Service<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">(UPnPHost-Out)<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Description<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Outbound<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">rule<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">for<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">the<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Zune<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Network<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Sharing<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Service<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">to<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">allow<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">use<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">of<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Universal<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Plug<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">and<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Play.<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">[TCP]<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">ApplicationName<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">C:Windowssystem32svchost.exe<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">serviceName<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">upnphost<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Protocol<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #800000\">6<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">LocalPorts<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">*<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">RemotePorts<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">*<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">LocalAddresses<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">*<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">RemoteAddresses<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">LocalSubnet<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">IcmpTypesAndCodes<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp; <br \/><\/span><span style=\"color: #000000\">Direction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #800000\">2<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Interfaces<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp; <br \/><\/span><span style=\"color: #000000\">InterfaceTypes<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">All<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Enabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">False<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Grouping<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">@e:Program<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">Fileszuneresources.dll,-270<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Profiles<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #800000\">7<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">EdgeTraversal<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">False<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">Action<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #800000\">1<\/span><span style=\"color: #808080\"> <br \/><\/span><span style=\"color: #000000\">EdgeTraversalOptions<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">:<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #800000\">0<\/span><span style=\"color: #808080\"> <\/p>\n<p><\/span><span style=\"color: #000000\">&lt;output<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">truncated&gt;<\/span><span style=\"color: #808080\"> <br \/><\/span>\nThe output goes on and on and on. One thing I noticed is that there is an <strong>Enabled<\/strong> property returned for the <strong>Rule<\/strong> object. Therefore, filtering for enabled rules will reduce the output. In addition, I am primarily concerned with the protocol, the port, the direction, and of course the name of the rule. A table will be a nice way to display that information. The revised script is shown here.\n<strong>DisplayEnabledFirewallRules.ps1<\/strong>\n<span style=\"color: #2b91af\">$fw<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #0000ff\">=<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #0000ff\">New-Object<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">-ComObject<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">hnetcfg.fwpolicy2<\/span><span style=\"color: #808080\"> <\/p>\n<p><\/span><span style=\"color: #2b91af\">$fw<\/span><span style=\"color: #000000\">.rules<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">|<\/span><span style=\"color: #808080\"> <\/p>\n<p><\/span><span style=\"color: #0000ff\">Where-Object<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">{<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #2b91af\">$_<\/span><span style=\"color: #000000\">.enabled<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">}<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">|<\/span><span style=\"color: #808080\"> <\/p>\n<p><\/span><span style=\"color: #0000ff\">Sort-Object<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">-Property<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">direction<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">|<\/span><span style=\"color: #808080\"> <\/p>\n<p><\/span><span style=\"color: #0000ff\">Format-Table<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">-Property<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">direction,<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">protocol,<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">localports,<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">name<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">-AutoSize<\/span><span style=\"color: #808080\">&nbsp;<\/span><span style=\"color: #000000\">-Wrap<\/span>\n&nbsp;\nWhen the DisplayEnabledFirewallRules.ps1 script runs, the output shown in the following image is displayed.\n<a href=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/july\/hey0703\/wes-07-03-10-01.jpg\"><img decoding=\"async\" alt=\"Image of output displayed when script is run\" src=\"http:\/\/img.microsoft.com\/library\/media\/1033\/technet\/images\/scriptcenter\/qanda\/hsg\/2010\/july\/hey0703\/wes-07-03-10-01.jpg\"><\/a>\n&nbsp;\nIf you want to know exactly what we will be looking at tomorrow, follow us on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a> or <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send e-mail to us at <a href=\"http:\/\/blogs.technet.commailto:scripter@microsoft.com\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.\n&nbsp;\n<strong>Ed Wilson and Craig Liebendorfer, Scripting Guys<\/strong><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Microsoft Scripting Guy Ed Wilson here. The Scripting Wife and I are getting ready to head up to the mountains in search of a bit of cool air. Even if it is hot up there, it will still be cool because we are meeting one of my old high school friends. Actually, all of [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[161,3,63,61,45],"class_list":["post-17871","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-firewall","tag-scripting-guy","tag-security","tag-weekend-scripter","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; Microsoft Scripting Guy Ed Wilson here. The Scripting Wife and I are getting ready to head up to the mountains in search of a bit of cool air. Even if it is hot up there, it will still be cool because we are meeting one of my old high school friends. Actually, all of [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/17871","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=17871"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/17871\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=17871"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=17871"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=17871"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}