<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Personal website of Dave Hope &#187; vbScript</title>
	<atom:link href="http://davehope.co.uk/Blog/tag/vbscript/feed/" rel="self" type="application/rss+xml" />
	<link>http://davehope.co.uk</link>
	<description>Open source projects, sysadmin stuff and general geekage</description>
	<lastBuildDate>Tue, 18 May 2010 11:46:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Remotely check Windows firewall status</title>
		<link>http://davehope.co.uk/Blog/remotely-check-windows-firewall-status/</link>
		<comments>http://davehope.co.uk/Blog/remotely-check-windows-firewall-status/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 11:10:37 +0000</pubDate>
		<dc:creator>Dave</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[vbScript]]></category>
		<category><![CDATA[Windows Firewall]]></category>

		<guid isPermaLink="false">http://davehope.co.uk/?p=63</guid>
		<description><![CDATA[As part of my routine auditing process I wanted to check to ensure that the Windows firewall is enabled and set to use its domain profile on all of our Member servers. Here&#8217;s a script to do just that ' Configuration. '==================================================================== Dim strFirewallStatus, strComputer, arrComputers arrComputers = Split("london,brisbane,perth,chicago", ",") WScript.Echo "-------------------------------------------------------" WScript.Echo Left("Computer Name" [...]]]></description>
			<content:encoded><![CDATA[<p>As part of my routine auditing process I wanted to check to ensure that the Windows firewall is enabled and set to use its domain profile on all of our Member servers.</p>
<p>Here&#8217;s a script to do just that</p>
<pre>' Configuration.
'====================================================================
Dim strFirewallStatus, strComputer, arrComputers
arrComputers = Split("london,brisbane,perth,chicago", ",")

WScript.Echo "-------------------------------------------------------"
WScript.Echo Left("Computer Name" &amp; Space(47),47) &amp; "Status"
WScript.Echo "-------------------------------------------------------"

' Iterate through computers, showing status.
'====================================================================
For Each strComputer in arrComputers

  ' Required so we don't die on permission errors.
  On Error Resume Next

  Set objReg = GetObject( "winmgmts:{impersonationLevel" &#038;_
  "=impersonate}!\\" &#038; strComputer &#038; "\root\default:StdRegProv")

  If err.number = 0 Then
    objReg.GetDWORDValue &#038;H80000002, "SYSTEM\CurrentControlSet\" &#038;_
    "Services\SharedAccess\Parameters\FirewallPolicy\" &#038;_
    "DomainProfile\", "EnableFirewall",dwValue

    If dwValue <> 0 Then
      strFirewallStatus = "Enabled"
    Else
      strFirewallStatus = "Disabled"
    End If

    WScript.Echo Left(strComputer &#038; Space(47),47) &#038; strFirewallStatus

  Else
    WScript.Echo strComputer &#038; " - Error" &#038; err.number &#038; " : " &#038;_
    err.description
    err.clear
  End if
Next</pre>
<p>You&#8217;ll need to make sure that you&#8217;ve got the relevant permissions on the target computers, otherwise you&#8217;ll just get errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://davehope.co.uk/Blog/remotely-check-windows-firewall-status/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
