<?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>Andrew Healey's Blog &#187; Technology</title>
	<atom:link href="http://halfloaded.com/blog/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://halfloaded.com</link>
	<description>Smash forehead on keyboard to continue...</description>
	<lastBuildDate>Tue, 20 Jul 2010 18:11:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>vbScript: Quickly determine architecture</title>
		<link>http://halfloaded.com/blog/vbscript-quickly-determine-architecture/</link>
		<comments>http://halfloaded.com/blog/vbscript-quickly-determine-architecture/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 18:10:11 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[vbScript]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[x64]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=442</guid>
		<description><![CDATA[I&#8217;ve been using a routine to determine 64-bit v 32-bit workstations for some time checking the registry for the PROCESSOR_ARCHITECTURE in the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment path. However, this was proving to be error prone. So, I just gave up that method altogether since all Windows x64 editions have a &#8220;%SystemDrive%\Program Files (x86)&#8221; directory. This makes it [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://halfloaded.com/wp-content/uploads/2010/07/32-64.jpg"><img src="http://halfloaded.com/wp-content/uploads/2010/07/32-64-150x150.jpg" alt="" title="XP x64" width="150" height="150" class="alignright size-thumbnail wp-image-445" /></a>I&#8217;ve been using a routine to determine 64-bit v 32-bit workstations for some time checking the registry for the PROCESSOR_ARCHITECTURE in the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment path.  However, this was proving to be error prone.  So, I just gave up that method altogether since all Windows x64 editions have a &#8220;%SystemDrive%\Program Files (x86)&#8221; directory.  This makes it just a quick and easy call the folderexists method of the filesystemobject.</p>
<p>The only downside is that can&#8217;t be used remotely but since most of my scripts are used in local policies, this shouldn&#8217;t be an issue.</p>
<p>Cheers!</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> is64bit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0600FF;">Dim</span> filesys : <span style="color: #FF8000;">Set</span> filesys <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0600FF;">Dim</span> bln64bit : bln64bit <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
	<span style="color: #0600FF;">If</span> filesys.<span style="color: #0000FF;">FolderExists</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;C:\Program Files (x86)&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">then</span> bln64bit <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
	is64bit <span style="color: #008000;">=</span> bln64bit
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;t=vbScript%3A+Quickly+determine+architecture" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;title=vbScript%3A+Quickly+determine+architecture&amp;summary=I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=vbScript%3A+Quickly+determine+architecture+-+File: /data/app/webapp/functions.php<br />Line: 43<br />Message: Table 'b2l_shrinker.phurl_urls' doesn't exist&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=vbScript%3A+Quickly+determine+architecture&amp;du=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;cn=I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;title=vbScript%3A+Quickly+determine+architecture" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;submitHeadline=vbScript%3A+Quickly+determine+architecture&amp;submitSummary=I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/vbscript-quickly-determine-architecture/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/vbscript-quickly-determine-architecture/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22vbScript%3A%20Quickly%20determine%20architecture%22&amp;body=Link: http://halfloaded.com/blog/vbscript-quickly-determine-architecture/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%27ve%20been%20using%20a%20routine%20to%20determine%2064-bit%20v%2032-bit%20workstations%20for%20some%20time%20checking%20the%20registry%20for%20the%20PROCESSOR_ARCHITECTURE%20in%20the%20HKLM%5CSYSTEM%5CCurrentControlSet%5CControl%5CSession%20Manager%5CEnvironment%20path.%20%20However%2C%20this%20was%20proving%20to%20be%20error%20prone.%20%20So%2C%20I%20just%20gave%20up%20that%20method%20altogeth" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/vbscript-quickly-determine-architecture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Java via Script and Group Policy</title>
		<link>http://halfloaded.com/blog/installing-java-via-script-and-group-policy/</link>
		<comments>http://halfloaded.com/blog/installing-java-via-script-and-group-policy/#comments</comments>
		<pubDate>Fri, 16 Jul 2010 17:39:14 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[group policy]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jre]]></category>
		<category><![CDATA[vbScript]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=437</guid>
		<description><![CDATA[Due to some software requirements, there was a need to get JRE 1.5.0_09 rolled out across our enterprise. The requirements were pretty straight forward: Only install on client operating systems (Windows 2000, Windows XP, Windows Vista and Windows 7) Detect the versions of Java installed. If 1.5.0_09 is installed, exit.  If 1.5.0_08 or less was [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://halfloaded.com/wp-content/uploads/2010/07/javalogo.png"><img src="http://halfloaded.com/wp-content/uploads/2010/07/javalogo-150x150.png" alt="" title="javalogo" width="150" height="150" class="alignright size-thumbnail wp-image-439" /></a>Due to some software requirements, there was a need to get JRE 1.5.0_09 rolled out across our enterprise.  The requirements were pretty straight forward:</p>
<ul>
<li>Only install on client operating systems (Windows 2000, Windows XP, Windows Vista and Windows 7)</li>
<li>Detect the versions of Java installed. If 1.5.0_09 is installed, exit.  If 1.5.0_08 or less was installed, install this version.  If it has a newer version, do nothing.</li>
</ul>
<p>The best way of determining the Java versions is to look in %program files%.  On 64-bit machines, this is &#8220;C:\program files (x86)\Java&#8221;.  On 32-bit, this is &#8220;C:\program files\Java&#8221;.  The script accounts for this.</p>
<p>I wanted to post this because several of the functions used are very useful.  The share hosting the jre runtime needs to have wide open read-only access so the Local System account can access share (Domain Computers).  This script can then be applied to machine accounts in group policy as a startup script.  If you want to test this, just comment out line 111.</p>
<p>Cheers!<br />
<a href='http://halfloaded.com/wp-content/uploads/2010/07/install-java.zip'>Download Compressed (.zip) script</a></p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">'======================================================</span>
<span style="color: #008080; font-style: italic;">' VBScript Source File</span>
<span style="color: #008080; font-style: italic;">' NAME: Java Runtime Environment Installation</span>
<span style="color: #008080; font-style: italic;">' AUTHOR: Andrew J Healey</span>
<span style="color: #008080; font-style: italic;">' DATE  : 2010.07.15</span>
<span style="color: #008080; font-style: italic;">' COMMENT: This script will install the jre references based on processor, existing </span>
<span style="color: #008080; font-style: italic;">' 				   installations, and operating system.  This script is to be run at startup</span>
<span style="color: #008080; font-style: italic;">'				   under the Local System account. No user interaction is required for </span>
<span style="color: #008080; font-style: italic;">'				   this script to work properly.</span>
<span style="color: #008080; font-style: italic;">'======================================================</span>
&nbsp;
<span style="color: #FF8000;">Option</span> Explicit
&nbsp;
<span style="color: #0600FF;">If</span> isClientOperatingSystem <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span> <span style="color: #FF8000;">Then</span> wscript.<span style="color: #0000FF;">quit</span>
&nbsp;
<span style="color: #0600FF;">Dim</span> jreVerMajor, jreVerMinor
<span style="color: #0600FF;">Dim</span> strCommand, strPathToInstall, strInstallFile, strArguments
&nbsp;
<span style="color: #008080; font-style: italic;">'============== BEGIN CONFIGURATION SECTION =================</span>
jreVerMajor <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;jre1.5.0_&quot;</span> <span style="color: #008080; font-style: italic;">'As string</span>
jreVerMinor <span style="color: #008000;">=</span> <span style="color: #FF0000;">9</span> <span style="color: #008080; font-style: italic;">'As Integer for &lt;&gt; operations</span>
strPathToInstall <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;\\servername\Software\Java\&quot;</span> <span style="color: #008080; font-style: italic;">'Point to share \\servername\share\folder\</span>
strInstallFile <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;jre-1_5_0_09-windows-i586-p.exe&quot;</span>
strArguments <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;/s /v /qn ADDLOCAL=jrecore,extra IEXPLORER=1 REBOOT=Suppress JAVAUPDATE=0 SYSTRAY=0 WEBSTARTICON=0&quot;</span>
strCommand <span style="color: #008000;">=</span> strPathToInstall <span style="color: #008000;">&amp;</span> strInstallFile <span style="color: #008000;">&amp;</span> <span style="color: #808080;">&quot; &quot;</span> <span style="color: #008000;">&amp;</span> strArguments
<span style="color: #008080; font-style: italic;">'============== END CONFIGURATION SECTION =================</span>
&nbsp;
<span style="color: #0600FF;">If</span> checkForJRE<span style="color: #000000;">&#40;</span>jreVerMajor, jreVerMinor<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span> <span style="color: #FF8000;">Then</span>
	<span style="color: #0600FF;">Call</span> InstallJava<span style="color: #000000;">&#40;</span>strCommand<span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> checkForJRE<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> jreVerMajor, <span style="color: #FF8000;">ByVal</span> jreVerMinor<span style="color: #000000;">&#41;</span>
	<span style="color: #0600FF;">Dim</span> jrePath
	<span style="color: #0600FF;">Dim</span> blnMajorFound : blnMajorFound <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
	<span style="color: #0600FF;">Dim</span> blnMinorFound : blnMinorFound <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
&nbsp;
	<span style="color: #0600FF;">If</span> is32bit <span style="color: #FF8000;">Then</span>
		jrePath <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;C:\Program Files\Java\&quot;</span>
	<span style="color: #FF8000;">Else</span>
		jrePath <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;C:\Program Files (x86)\Java\&quot;</span>
	<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #0600FF;">Dim</span> objFSO : <span style="color: #FF8000;">Set</span> objFSO <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">Dim</span> objFolder : <span style="color: #FF8000;">Set</span> objFolder <span style="color: #008000;">=</span> objFSO.<span style="color: #0000FF;">GetFolder</span><span style="color: #000000;">&#40;</span>jrePath<span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">Dim</span> colSubfolders : <span style="color: #FF8000;">Set</span> colSubfolders <span style="color: #008000;">=</span> objFolder.<span style="color: #0000FF;">Subfolders</span>
		<span style="color: #0600FF;">Dim</span> objSubfolder
&nbsp;
		<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> objSubfolder in colSubfolders
			<span style="color: #0600FF;">If</span> <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span>objSubfolder.<span style="color: #0000FF;">Name</span>,<span style="color: #FF8000;">Len</span><span style="color: #000000;">&#40;</span>jreVerMajor<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> jreVerMajor <span style="color: #FF8000;">Then</span>
				blnMajorFound <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
				<span style="color: #0600FF;">If</span> <span style="color: #0600FF;">CInt</span><span style="color: #000000;">&#40;</span><span style="color: #0600FF;">Right</span><span style="color: #000000;">&#40;</span>objSubfolder.<span style="color: #0000FF;">Name</span>,<span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> &gt;<span style="color: #008000;">=</span> jreVerMinor <span style="color: #FF8000;">Then</span>
					blnMinorFound <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
				<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
			<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
		<span style="color: #FF8000;">Next</span>
&nbsp;
		<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> &lt;&gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span>
			chechForJRE <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
			<span style="color: #0600FF;">Exit</span> <span style="color: #0600FF;">Function</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
		<span style="color: #0600FF;">If</span> blnMajorFound <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span> <span style="color: #804040;">And</span> blnMinorFound <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span> <span style="color: #FF8000;">Then</span>
			checkForJRE <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
		<span style="color: #FF8000;">Else</span>
			checkForJRE <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
&nbsp;
	<span style="color: #FF8000;">Set</span> objSubfolder <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	<span style="color: #FF8000;">Set</span> colSubfolders <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	<span style="color: #FF8000;">Set</span> objFolder <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	<span style="color: #FF8000;">Set</span> objFSO <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	jrePath <span style="color: #008000;">=</span> <span style="color: #FF8000;">Empty</span>
	blnMajorFound <span style="color: #008000;">=</span> <span style="color: #FF8000;">Null</span>
	blnMinorFound <span style="color: #008000;">=</span> <span style="color: #FF8000;">Null</span>
	jreVerMajor <span style="color: #008000;">=</span> <span style="color: #FF8000;">Empty</span>
	jreVerMinor <span style="color: #008000;">=</span> <span style="color: #FF8000;">Empty</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span> 
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> is32bit<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Get processor architecture; do not use remotely</span>
	<span style="color: #0600FF;">const</span> HKEY_LOCAL_MACHINE <span style="color: #008000;">=</span> <span style="color: #008000;">&amp;</span>H80000002
	<span style="color: #0600FF;">Dim</span> oReg,strKeyPath,strValueName
	<span style="color: #0600FF;">Dim</span> strValue
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #FF8000;">Set</span> oReg<span style="color: #008000;">=</span>GetObject<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
		strKeyPath <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;SYSTEM\CurrentControlSet\Control\Session Manager\Environment&quot;</span>
		strValueName <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;PROCESSOR_ARCHITECTURE&quot;</span>
		oReg.<span style="color: #0000FF;">GetStringValue</span> HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
&nbsp;
		<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> &lt;&gt; <span style="color: #FF0000;">0</span> or strValue <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;x86&quot;</span> <span style="color: #FF8000;">Then</span>
			is32bit <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
		<span style="color: #FF8000;">Else</span>
			is32bit <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
		<span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Clear</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
&nbsp;
	<span style="color: #FF8000;">Set</span> oReg <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	strKeyPath <span style="color: #008000;">=</span> <span style="color: #FF8000;">Empty</span>
	strValueName <span style="color: #008000;">=</span> <span style="color: #FF8000;">Empty</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span> 
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> InstallJava<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> strCommand<span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #0600FF;">Dim</span> objWshShell, intRC
&nbsp;
		<span style="color: #FF8000;">Set</span> objWshShell <span style="color: #008000;">=</span> WScript.<span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;WScript.Shell&quot;</span><span style="color: #000000;">&#41;</span>
		intRC <span style="color: #008000;">=</span> objWshShell.<span style="color: #0000FF;">Run</span><span style="color: #000000;">&#40;</span>strCommand, <span style="color: #FF0000;">0</span>, <span style="color: #0600FF;">True</span><span style="color: #000000;">&#41;</span>
&nbsp;
		<span style="color: #0600FF;">If</span> intRC &lt;&gt; <span style="color: #FF0000;">0</span> Or <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> &lt;&gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span>
			InstallJava <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Failed&quot;</span>
		<span style="color: #FF8000;">Else</span>
			InstallJava <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;Success&quot;</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
	<span style="color: #FF8000;">Set</span> objWshShell <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	intRC <span style="color: #008000;">=</span> <span style="color: #FF8000;">Empty</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span> 
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> isClientOperatingSystem<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0600FF;">Dim</span> objWMIService, objItem, colItems
	<span style="color: #0600FF;">Dim</span> strOS
&nbsp;
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #008080; font-style: italic;">' WMI Connection to the object in the CIM namespace</span>
		<span style="color: #FF8000;">Set</span> objWMIService <span style="color: #008000;">=</span> GetObject<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;winmgmts:\\.\root\cimv2&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
		<span style="color: #008080; font-style: italic;">' WMI Query to the Win32_OperatingSystem</span>
		<span style="color: #FF8000;">Set</span> colItems <span style="color: #008000;">=</span> objWMIService.<span style="color: #0000FF;">ExecQuery</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Select * from Win32_OperatingSystem&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
		<span style="color: #008080; font-style: italic;">' For Each... In Loop (Next at the very end)</span>
		<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> objItem in colItems
			strOS <span style="color: #008000;">=</span> objItem.<span style="color: #0000FF;">Caption</span>
		<span style="color: #FF8000;">Next</span>
&nbsp;
		<span style="color: #0600FF;">If</span> <span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strOS,<span style="color: #808080;">&quot;Windows 7&quot;</span><span style="color: #000000;">&#41;</span> &lt;&gt; <span style="color: #FF0000;">0</span> Or <span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strOS,<span style="color: #808080;">&quot;XP&quot;</span><span style="color: #000000;">&#41;</span> &lt;&gt; <span style="color: #FF0000;">0</span> Or <span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strOS,<span style="color: #808080;">&quot;2000 Professional&quot;</span><span style="color: #000000;">&#41;</span> &lt;&gt; <span style="color: #FF0000;">0</span> Or <span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strOS,<span style="color: #808080;">&quot;Vista&quot;</span><span style="color: #000000;">&#41;</span> &lt;&gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span>
			isClientOperatingSystem <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
		<span style="color: #FF8000;">Else</span>
			isClientOperatingSystem <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
		<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> &lt;&gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span> isClientOperatingSystem <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
&nbsp;
		strOS <span style="color: #008000;">=</span> <span style="color: #FF8000;">Empty</span>
		<span style="color: #FF8000;">Set</span> objItem <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
		<span style="color: #FF8000;">Set</span> colItems <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
		<span style="color: #FF8000;">Set</span> objWMIService <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/installing-java-via-script-and-group-policy/&amp;t=Installing+Java+via+Script+and+Group+Policy" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/installing-java-via-script-and-group-policy/&amp;title=Installing+Java+via+Script+and+Group+Policy&amp;summary=Due%20to%20some%20software%20requirements%2C%20there%20was%20a%20need%20to%20get%20JRE%201.5.0_09%20rolled%20out%20across%20our%20enterprise.%20%20The%20requirements%20were%20pretty%20straight%20forward%3A%0D%0A%0D%0A%09Only%20install%20on%20client%20operating%20systems%20%28Windows%202000%2C%20Windows%20XP%2C%20Windows%20Vista%20and%20Windows%207%29%0D%0A%09Detect%20the%20versions%20of%20Java%20installed.%20If%201&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Installing+Java+via+Script+and+Group+Policy+-+http://b2l.me/aa437s&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Installing+Java+via+Script+and+Group+Policy&amp;du=http://halfloaded.com/blog/installing-java-via-script-and-group-policy/&amp;cn=Due%20to%20some%20software%20requirements%2C%20there%20was%20a%20need%20to%20get%20JRE%201.5.0_09%20rolled%20out%20across%20our%20enterprise.%20%20The%20requirements%20were%20pretty%20straight%20forward%3A%0D%0A%0D%0A%09Only%20install%20on%20client%20operating%20systems%20%28Windows%202000%2C%20Windows%20XP%2C%20Windows%20Vista%20and%20Windows%207%29%0D%0A%09Detect%20the%20versions%20of%20Java%20installed.%20If%201" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/installing-java-via-script-and-group-policy/&amp;title=Installing+Java+via+Script+and+Group+Policy" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/installing-java-via-script-and-group-policy/&amp;submitHeadline=Installing+Java+via+Script+and+Group+Policy&amp;submitSummary=Due%20to%20some%20software%20requirements%2C%20there%20was%20a%20need%20to%20get%20JRE%201.5.0_09%20rolled%20out%20across%20our%20enterprise.%20%20The%20requirements%20were%20pretty%20straight%20forward%3A%0D%0A%0D%0A%09Only%20install%20on%20client%20operating%20systems%20%28Windows%202000%2C%20Windows%20XP%2C%20Windows%20Vista%20and%20Windows%207%29%0D%0A%09Detect%20the%20versions%20of%20Java%20installed.%20If%201&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/installing-java-via-script-and-group-policy/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/installing-java-via-script-and-group-policy/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Installing%20Java%20via%20Script%20and%20Group%20Policy%22&amp;body=Link: http://halfloaded.com/blog/installing-java-via-script-and-group-policy/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Due%20to%20some%20software%20requirements%2C%20there%20was%20a%20need%20to%20get%20JRE%201.5.0_09%20rolled%20out%20across%20our%20enterprise.%20%20The%20requirements%20were%20pretty%20straight%20forward%3A%0D%0A%0D%0A%09Only%20install%20on%20client%20operating%20systems%20%28Windows%202000%2C%20Windows%20XP%2C%20Windows%20Vista%20and%20Windows%207%29%0D%0A%09Detect%20the%20versions%20of%20Java%20installed.%20If%201" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/installing-java-via-script-and-group-policy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell: Getting the IP Address, FQDN and MAC Address of Each Domain Controller</title>
		<link>http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/</link>
		<comments>http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/#comments</comments>
		<pubDate>Thu, 01 Apr 2010 17:49:19 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[posh]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=412</guid>
		<description><![CDATA[I was asked to get a baseline for generating reports within AD.  The two important pieces of information which were required to generate these reports were the ip address and FQDN of each domain controller.  The script would then connect to each individual system to gather data.  While I was at it, I added the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://halfloaded.com/wp-content/uploads/2010/04/posh.png"><img src="http://halfloaded.com/wp-content/uploads/2010/04/posh-150x150.png" alt="" title="posh" width="150" height="150" class="alignright size-thumbnail wp-image-414" /></a>I was asked to get a baseline for generating reports within AD.  The two important pieces of information which were required to generate these reports were the ip address and FQDN of each domain controller.  The script would then connect to each individual system to gather data.  While I was at it, I added the MAC Address just to see what other pieces of data would be useful out of the <a href="http://msdn.microsoft.com/en-us/library/aa394217%28VS.85%29.aspx" target="_blank">Win32_NetworkAdapterConfiguration</a> class.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;">#Enter the fqdn of your forest/domain</span>
<span style="color: #800080;">$fqdn</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;fully.qualified.domain.name&quot;</span>
<span style="color: #008000;">#Create Empty HashTable</span>
<span style="color: #800080;">$ht</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> psobject <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select</span> FQDN<span style="color: pink;">,</span> MACAddress<span style="color: pink;">,</span> IPAddress
&nbsp;
<span style="color: #008000;">#Enumerate Domain Controllers</span>
<span style="color: #800080;">$context</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">new-object</span> System.DirectoryServices.ActiveDirectory.DirectoryContext<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;Domain&quot;</span><span style="color: pink;">,</span><span style="color: #800080;">$fqdn</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$dclist</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>System.DirectoryServices.ActiveDirectory.DomainController<span style="color: #000000;">&#93;</span>::findall<span style="color: #000000;">&#40;</span><span style="color: #800080;">$context</span><span style="color: #000000;">&#41;</span>
<span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$strComputer</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$dclist</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
	<span style="color: #008000;">#Get IP Info of each DC</span>
	<span style="color: #800080;">$colItems</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">GWMI</span> <span style="color: pink;">-</span>cl <span style="color: #800000;">&quot;Win32_NetworkAdapterConfiguration&quot;</span> <span style="color: #008080; font-style: italic;">-name</span> <span style="color: #800000;">&quot;root\CimV2&quot;</span> <span style="color: pink;">-</span>comp `
                <span style="color: #800080;">$strComputer</span>.name <span style="color: pink;">-</span><span style="color: #0000FF;">filter</span> <span style="color: #800000;">&quot;IpEnabled = TRUE&quot;</span>
	<span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$objItem</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$colItems</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span>
        <span style="color: #800080;">$ht</span>.FQDN <span style="color: pink;">=</span> <span style="color: #800080;">$strComputer</span>
        <span style="color: #800080;">$ht</span>.MACAddress <span style="color: pink;">=</span> <span style="color: #800080;">$objItem</span>.MacAddress
        <span style="color: #800080;">$ht</span>.IPAddress <span style="color: pink;">=</span> <span style="color: #800080;">$objItem</span>.IpAddress
	<span style="color: #000000;">&#125;</span>
    <span style="color: #800080;">$ht</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/&amp;t=Powershell%3A+Getting+the+IP+Address%2C+FQDN+and+MAC+Address+of+Each+Domain+Controller" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/&amp;title=Powershell%3A+Getting+the+IP+Address%2C+FQDN+and+MAC+Address+of+Each+Domain+Controller&amp;summary=I%20was%20asked%20to%20get%20a%20baseline%20for%20generating%20reports%20within%20AD.%C2%A0%20The%20two%20important%20pieces%20of%20information%20which%20were%20required%20to%20generate%20these%20reports%20were%20the%20ip%20address%20and%20FQDN%20of%20each%20domain%20controller.%C2%A0%20The%20script%20would%20then%20connect%20to%20each%20individual%20system%20to%20gather%20data.%C2%A0%20While%20I%20was%20at%20i&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Powershell%3A+Getting+the+IP+Address%2C+FQDN+and+MAC+Address+of+Each+Domain+Controll%5B..%5D+-+http://b2l.me/7d6G8&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Powershell%3A+Getting+the+IP+Address%2C+FQDN+and+MAC+Address+of+Each+Domain+Controller&amp;du=http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/&amp;cn=I%20was%20asked%20to%20get%20a%20baseline%20for%20generating%20reports%20within%20AD.%C2%A0%20The%20two%20important%20pieces%20of%20information%20which%20were%20required%20to%20generate%20these%20reports%20were%20the%20ip%20address%20and%20FQDN%20of%20each%20domain%20controller.%C2%A0%20The%20script%20would%20then%20connect%20to%20each%20individual%20system%20to%20gather%20data.%C2%A0%20While%20I%20was%20at%20i" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/&amp;title=Powershell%3A+Getting+the+IP+Address%2C+FQDN+and+MAC+Address+of+Each+Domain+Controller" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/&amp;submitHeadline=Powershell%3A+Getting+the+IP+Address%2C+FQDN+and+MAC+Address+of+Each+Domain+Controller&amp;submitSummary=I%20was%20asked%20to%20get%20a%20baseline%20for%20generating%20reports%20within%20AD.%C2%A0%20The%20two%20important%20pieces%20of%20information%20which%20were%20required%20to%20generate%20these%20reports%20were%20the%20ip%20address%20and%20FQDN%20of%20each%20domain%20controller.%C2%A0%20The%20script%20would%20then%20connect%20to%20each%20individual%20system%20to%20gather%20data.%C2%A0%20While%20I%20was%20at%20i&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Powershell%3A%20Getting%20the%20IP%20Address%2C%20FQDN%20and%20MAC%20Address%20of%20Each%20Domain%20Controller%22&amp;body=Link: http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A I%20was%20asked%20to%20get%20a%20baseline%20for%20generating%20reports%20within%20AD.%C2%A0%20The%20two%20important%20pieces%20of%20information%20which%20were%20required%20to%20generate%20these%20reports%20were%20the%20ip%20address%20and%20FQDN%20of%20each%20domain%20controller.%C2%A0%20The%20script%20would%20then%20connect%20to%20each%20individual%20system%20to%20gather%20data.%C2%A0%20While%20I%20was%20at%20i" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/powershell-getting-the-ip-address-fqdn-and-mac-address-of-each-domain-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Powershell: Using PoSH to Search Across Multiple Domains in Forest</title>
		<link>http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/</link>
		<comments>http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 20:52:07 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[posh]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=404</guid>
		<description><![CDATA[I was recently asked to get a quick report of all Windows 7 computers within a multi-domain AD forest.  After banging my head into the keyboard for a while, I finally figured it out.  The script below should do the trick. Also, if you use the OperatingSystemVersion attribute, you will find that Server 2008 R2 [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://halfloaded.com/wp-content/uploads/2010/01/powershell2xa41.jpg"><img src="http://halfloaded.com/wp-content/uploads/2010/01/powershell2xa41-150x150.jpg" alt="" title="powershell" width="150" height="150" class="alignright size-thumbnail wp-image-408" /></a><br />
I was recently asked to get a quick report of all Windows 7 computers within a multi-domain AD forest.  After banging my head into the keyboard for a while, I finally figured it out.  The script below should do the trick.</p>
<p>Also, if you use the OperatingSystemVersion attribute, you will find that Server 2008 R2 shares version &#8220;6.1 (7600)&#8221;.  So, the best way to find Windows 7 only, is to search for &#8220;Windows 7*&#8221; with the wildcard character against the OperatingSystem attribute.  That will ensure all Windows 7 versions are returned and will exclude Server 2008 R2 from your results.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="powershell" style="font-family:monospace;"><span style="color: #008000;">#Get Domain List</span>
<span style="color: #800080;">$objForest</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>System.DirectoryServices.ActiveDirectory.Forest<span style="color: #000000;">&#93;</span>::GetCurrentForest<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$DomainList</span> <span style="color: pink;">=</span> <span style="color: pink;">@</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$objForest</span>.Domains <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Select-Object</span> Name<span style="color: #000000;">&#41;</span>
<span style="color: #800080;">$Domains</span> <span style="color: pink;">=</span> <span style="color: #800080;">$DomainList</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#123;</span><span style="color: #000080;">$_</span>.Name<span style="color: #000000;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #008000;">#Act on each domain</span>
<span style="color: #0000FF;">foreach</span><span style="color: #000000;">&#40;</span><span style="color: #800080;">$Domain</span> <span style="color: #0000FF;">in</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$Domains</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #000000;">&#123;</span>
	<span style="color: #008080; font-weight: bold;">Write-Host</span> <span style="color: #800000;">&quot;Checking $Domain&quot;</span> <span style="color: pink;">-</span>fore red
	<span style="color: #800080;">$ADsPath</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>ADSI<span style="color: #000000;">&#93;</span><span style="color: #800000;">&quot;LDAP://$Domain&quot;</span>
	<span style="color: #800080;">$objSearcher</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">New-Object</span> System.DirectoryServices.DirectorySearcher<span style="color: #000000;">&#40;</span><span style="color: #800080;">$ADsPath</span><span style="color: #000000;">&#41;</span>
	<span style="color: #800080;">$objSearcher</span>.<span style="color: #0000FF;">Filter</span> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;(&amp;(objectCategory=Computer)(operatingSystem=Windows 7*))&quot;</span>
	<span style="color: #800080;">$objSearcher</span>.SearchScope <span style="color: pink;">=</span> <span style="color: #800000;">&quot;Subtree&quot;</span>
&nbsp;
	<span style="color: #800080;">$colResults</span> <span style="color: pink;">=</span> <span style="color: #800080;">$objSearcher</span>.FindAll<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
&nbsp;
	<span style="color: #0000FF;">foreach</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$objResult</span> <span style="color: #0000FF;">in</span> <span style="color: #800080;">$colResults</span><span style="color: #000000;">&#41;</span>
	<span style="color: #000000;">&#123;</span>
		<span style="color: #800080;">$Computer</span> <span style="color: pink;">=</span> <span style="color: #800080;">$objResult</span>.GetDirectoryEntry<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #800080;">$Computer</span>.DistinguishedName
	<span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/&amp;t=Powershell%3A+Using+PoSH+to+Search+Across+Multiple+Domains+in+Forest" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/&amp;title=Powershell%3A+Using+PoSH+to+Search+Across+Multiple+Domains+in+Forest&amp;summary=%0D%0AI%20was%20recently%20asked%20to%20get%20a%20quick%20report%20of%20all%20Windows%207%20computers%20within%20a%20multi-domain%20AD%20forest.%C2%A0%20After%20banging%20my%20head%20into%20the%20keyboard%20for%20a%20while%2C%20I%20finally%20figured%20it%20out.%C2%A0%20The%20script%20below%20should%20do%20the%20trick.%0D%0A%0D%0AAlso%2C%20if%20you%20use%20the%20OperatingSystemVersion%20attribute%2C%20you%20will%20find%20th&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Powershell%3A+Using+PoSH+to+Search+Across+Multiple+Domains+in+Forest+-+http://b2l.me/7d6K6&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Powershell%3A+Using+PoSH+to+Search+Across+Multiple+Domains+in+Forest&amp;du=http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/&amp;cn=%0D%0AI%20was%20recently%20asked%20to%20get%20a%20quick%20report%20of%20all%20Windows%207%20computers%20within%20a%20multi-domain%20AD%20forest.%C2%A0%20After%20banging%20my%20head%20into%20the%20keyboard%20for%20a%20while%2C%20I%20finally%20figured%20it%20out.%C2%A0%20The%20script%20below%20should%20do%20the%20trick.%0D%0A%0D%0AAlso%2C%20if%20you%20use%20the%20OperatingSystemVersion%20attribute%2C%20you%20will%20find%20th" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/&amp;title=Powershell%3A+Using+PoSH+to+Search+Across+Multiple+Domains+in+Forest" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/&amp;submitHeadline=Powershell%3A+Using+PoSH+to+Search+Across+Multiple+Domains+in+Forest&amp;submitSummary=%0D%0AI%20was%20recently%20asked%20to%20get%20a%20quick%20report%20of%20all%20Windows%207%20computers%20within%20a%20multi-domain%20AD%20forest.%C2%A0%20After%20banging%20my%20head%20into%20the%20keyboard%20for%20a%20while%2C%20I%20finally%20figured%20it%20out.%C2%A0%20The%20script%20below%20should%20do%20the%20trick.%0D%0A%0D%0AAlso%2C%20if%20you%20use%20the%20OperatingSystemVersion%20attribute%2C%20you%20will%20find%20th&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Powershell%3A%20Using%20PoSH%20to%20Search%20Across%20Multiple%20Domains%20in%20Forest%22&amp;body=Link: http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %0D%0AI%20was%20recently%20asked%20to%20get%20a%20quick%20report%20of%20all%20Windows%207%20computers%20within%20a%20multi-domain%20AD%20forest.%C2%A0%20After%20banging%20my%20head%20into%20the%20keyboard%20for%20a%20while%2C%20I%20finally%20figured%20it%20out.%C2%A0%20The%20script%20below%20should%20do%20the%20trick.%0D%0A%0D%0AAlso%2C%20if%20you%20use%20the%20OperatingSystemVersion%20attribute%2C%20you%20will%20find%20th" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/powershell-using-posh-to-search-across-multiple-domains-in-forest/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Part 3: Blocking Bad Hosts &#8211; Blocking Them, Easily (CLI Edition)</title>
		<link>http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/</link>
		<comments>http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 19:13:57 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=349</guid>
		<description><![CDATA[In part two, I showed you how to use the Local Security Policy GUI to block the bad guys. There were a lot of pretty pictures for those that prefer the GUI. In this version, I’ll show you how to accomplish the same thing from the command line. This is my preferred method.  It is [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/">part two</a>, I showed you how to use the Local Security Policy GUI to block the bad guys.  There were a lot of pretty pictures for those tha<a href="http://halfloaded.com/wp-content/uploads/2009/12/command-line-big.png"><img class="alignright size-full wp-image-388" title="command-line-big" src="http://halfloaded.com/wp-content/uploads/2009/12/command-line-big.png" alt="" width="130" height="101" /></a>t prefer the GUI.  In this version, I’ll show you how to accomplish the same thing from the command line.  This is my preferred method.  It is much simpler to automate and explain.</p>
<p>By following the steps below, you will be able to create a new policy and manage the filter lists and actions.  The goal here will be to put all these pieces together into a nice tidy package that is fully automated.<span id="more-349"></span></p>
<p>The policy you create in this tutorial will not be applied to the system until you &#8220;Assign&#8221; the policy in Step 6.  As long as the policy is not assigned, you can safely edit, add, remove, etc. rules and sets to the policy without affecting the system.  <span style="color: #ff0000;"><em>Note: double and triple check your sets to ensure you do not block legitimate traffic before assigning the policy.</em></span></p>
<p>To begin this tutorial, open the command prompt. <span style="text-decoration: underline;"> If you don’t know how, you probably shouldn’t be doing this</span>.  All commands meant to be typed are in <em>italics</em>.</p>
<h3>Step 1: Create IP Security Policy</h3>
<p><em>netsh ipsec static add policy description=&#8221;This policy blocks all traffic to hosts/nets associated with it.&#8221;</em></p>
<h3>Step 2: Create an IP Filter List</h3>
<p><em>netsh ipsec static add filterlist description=&#8221;This filter list contains hosts and networks known to host malware, criminal activity, etc.&#8221;</em></p>
<h3>Step 3: Create IP Filters and Associate them with the Filter List (Repeat this step until all hosts you wish to block have been entered)</h3>
<p>Single IP (<strong>10.254.254.254/32</strong>)</p>
<p style="padding-left: 30px;"><em>netsh ipsec static add filter filterlist=&#8221;Bad Hosts&#8221; <strong>srcaddr=10.254.254.254</strong> dstaddr=any description=&#8221;John Smith. 12/31/2015. Brute force logon attempts to: SERVER01&#8243;</em></p>
<p>Subnet (<strong>10.254.254.0/24</strong>)</p>
<p style="padding-left: 30px;"><em>netsh ipsec static add filter filterlist=&#8221;Bad Hosts&#8221; <strong>srcaddr=10.254.254.0</strong> dstaddr=any <strong>srcmask=24</strong> description=&#8221;John Smith. 12/31/2015. Brute force logon attempts to: SERVER01&#8243;</em></p>
<p>Network Range (<strong>10.254.254.2-10</strong>)</p>
<p style="padding-left: 30px;"><em>netsh ipsec static add filter filterlist=&#8221;Bad Hosts&#8221; <strong>srcaddr=10.254.254.2-10.254.254.15</strong> dstaddr=any description=&#8221;John Smith. 12/31/2015. Brute force logon attempts to: SERVER01&#8243;</em></p>
<h3>Step 4: Create a Filter Action</h3>
<p><em>netsh ipsec static add filteraction description=&#8221;This action blocks all traffic.&#8221; action=block</em></p>
<h3>Step 5: Create Policy Rule to apply Filter Action to Filter List</h3>
<p><em>netsh ipsec static add rule policy=&#8221;Blocked Traffic&#8221; filterlist=&#8221;Bad Hosts&#8221; filteraction=&#8221;Block All Traffic&#8221; activate=yes</em></p>
<h3>Step 6: Assigning (and un-assigning) the Policy</h3>
<p>This step will apply all the settings you have created up to this point.  <span style="color: #ff0000;">Double and triple check that you did not enter a valid host or network or it will be blocked.  If fact, if you have any doubts in your mind, do not do this step until another person (who knows what they are doing) looks over your work too!  Note: This is one place MS will not give you a little &#8220;are you sure you want to do this&#8221; type of warning.  As soon as you assign the policy, it is done.</span></p>
<p><strong>Assign</strong></p>
<p style="padding-left: 30px;"><em>netsh ipsec static set policy name=&#8221;Blocked Traffic&#8221; assign=yes</em></p>
<p><strong>Un-assign</strong></p>
<p style="padding-left: 30px;"><em>netsh ipsec static set policy assign=no</em></p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/&amp;t=Part+3%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28CLI+Edition%29" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/&amp;title=Part+3%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28CLI+Edition%29&amp;summary=In%20part%20two%2C%20I%20showed%20you%20how%20to%20use%20the%20Local%20Security%20Policy%20GUI%20to%20block%20the%20bad%20guys.%20%20There%20were%20a%20lot%20of%20pretty%20pictures%20for%20those%20that%20prefer%20the%20GUI.%20%20In%20this%20version%2C%20I%E2%80%99ll%20show%20you%20how%20to%20accomplish%20the%20same%20thing%20from%20the%20command%20line.%20%20This%20is%20my%20preferred%20method.%C2%A0%20It%20is%20much%20simpler%20t&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Part+3%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28CLI+Edition%29+-+http://b2l.me/b792r&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Part+3%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28CLI+Edition%29&amp;du=http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/&amp;cn=In%20part%20two%2C%20I%20showed%20you%20how%20to%20use%20the%20Local%20Security%20Policy%20GUI%20to%20block%20the%20bad%20guys.%20%20There%20were%20a%20lot%20of%20pretty%20pictures%20for%20those%20that%20prefer%20the%20GUI.%20%20In%20this%20version%2C%20I%E2%80%99ll%20show%20you%20how%20to%20accomplish%20the%20same%20thing%20from%20the%20command%20line.%20%20This%20is%20my%20preferred%20method.%C2%A0%20It%20is%20much%20simpler%20t" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/&amp;title=Part+3%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28CLI+Edition%29" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/&amp;submitHeadline=Part+3%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28CLI+Edition%29&amp;submitSummary=In%20part%20two%2C%20I%20showed%20you%20how%20to%20use%20the%20Local%20Security%20Policy%20GUI%20to%20block%20the%20bad%20guys.%20%20There%20were%20a%20lot%20of%20pretty%20pictures%20for%20those%20that%20prefer%20the%20GUI.%20%20In%20this%20version%2C%20I%E2%80%99ll%20show%20you%20how%20to%20accomplish%20the%20same%20thing%20from%20the%20command%20line.%20%20This%20is%20my%20preferred%20method.%C2%A0%20It%20is%20much%20simpler%20t&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Part%203%3A%20Blocking%20Bad%20Hosts%20-%20Blocking%20Them%2C%20Easily%20%28CLI%20Edition%29%22&amp;body=Link: http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A In%20part%20two%2C%20I%20showed%20you%20how%20to%20use%20the%20Local%20Security%20Policy%20GUI%20to%20block%20the%20bad%20guys.%20%20There%20were%20a%20lot%20of%20pretty%20pictures%20for%20those%20that%20prefer%20the%20GUI.%20%20In%20this%20version%2C%20I%E2%80%99ll%20show%20you%20how%20to%20accomplish%20the%20same%20thing%20from%20the%20command%20line.%20%20This%20is%20my%20preferred%20method.%C2%A0%20It%20is%20much%20simpler%20t" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/part-3-blocking-bad-hosts-blocking-them-easily-cli-edition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Part 2: Blocking Bad Hosts &#8211; Blocking Them, Easily (GUI Edition)</title>
		<link>http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/</link>
		<comments>http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 09:13:58 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[ipsec]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=344</guid>
		<description><![CDATA[In part two, I want to show how you can quickly setup an ipsec policy to block the bad hosts you identified in part one. While many methods can be used to block hosts, using the Local Security Policy (secpol.msc) and ipsec is a simple method which can be fully automated. By following the steps [...]]]></description>
			<content:encoded><![CDATA[<p>In part two, I want to show how you can quickly setup an ipsec policy to block the bad hosts you identified in <a href="../blog/part-1-blocking-bad-hosts-finding-them-easily/">part one</a>. While many methods can be used to block hosts, using the Local Security Policy (secpol.msc) and ipsec is a simple method which can be fully automated.</p>
<p>By following the steps below, you will be able to create a new policy and manage the filter lists and actions. In part three, I will explain how this can be done from the command line for all you CLI warriors. This tutorial should be accurate for: Windows XP, Vista, 7 and Server 2003, 2008, 2008R2 (possibly even 2000)<span id="more-344"></span></p>
<p>The policy you create in this tutorial will not be applied to the system until you &#8220;Assign&#8221; the policy in Step 6. As long as the policy is not assigned, you can safely edit, add, remove, etc. rules and sets to the policy without affecting the system. <span style="color: #ff0000;"><em>Note: double and triple check your sets to ensure you do not block legitimate traffic before assigning the policy.</em></span></p>
<p>To begin this tutorial, open the Local Security Policy by:</p>
<ul>
<li>Control Panel → Administrative Tools → Local Security Policy</li>
<li>Start → Run → secpol.msc</li>
</ul>
<h3>Step 1: Create IP Security Policy</h3>
<ol>
<li>Right click &#8220;IP Security Policies on Local Computer&#8221;</li>
<li>Select &#8220;Create IP Security Policy&#8230;&#8221;</li>
<li>IP Security Policy Wizard
<ul>
<li>Welcome Screen → Next</li>
<li>IP Security Policy Name → Give a descriptive name and description → Next</li>
<li>Requests for Secure Communication → Do Not Check &#8220;Activate the default response rule&#8221; → Next</li>
<li>Wizard Completion → Do Not Check &#8220;Edit Properties&#8221; → Finish</li>
</ul>
</li>
</ol>
<p><a href="http://halfloaded.com/wp-content/uploads/2009/12/lsp-1.png"><img class="size-thumbnail wp-image-358 alignnone" title="lsp-1" src="http://halfloaded.com/wp-content/uploads/2009/12/lsp-1-150x150.png" alt="" width="150" height="150" /></a><a href="http://halfloaded.com/wp-content/uploads/2009/12/lsp-3.png"> <img class="alignnone size-thumbnail wp-image-360" title="lsp-3" src="http://halfloaded.com/wp-content/uploads/2009/12/lsp-3-150x150.png" alt="" width="150" height="150" /></a><a href="http://halfloaded.com/wp-content/uploads/2009/12/lsp-4.png"> <img class="alignnone size-thumbnail wp-image-361" title="lsp-4" src="http://halfloaded.com/wp-content/uploads/2009/12/lsp-4-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/lsp-5.png"><img class="alignnone size-thumbnail wp-image-362" title="lsp-5" src="http://halfloaded.com/wp-content/uploads/2009/12/lsp-5-150x150.png" alt="" width="150" height="150" /></a></p>
<h3>Step 2: Create an IP Filter List</h3>
<ol>
<li>Double click your new policy (or, right click and select properties)</li>
<li>On the Rules Tab → Uncheck &#8220;Use Add Wizard&#8221; → Click &#8220;Add&#8230;&#8221;</li>
<li>Create an IP Filter List
<ul>
<li>On the &#8220;IP Filter List&#8221; Tab → Click &#8220;Add&#8230;&#8221;</li>
<li>In the &#8220;IP Filter List&#8221; Window → Enter a descriptive name and description → Uncheck &#8220;Use Add Wizard&#8221; → Click &#8220;Add&#8230;&#8221;</li>
</ul>
</li>
</ol>
<p><a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-1.png"><img class="alignnone size-thumbnail wp-image-363" title="rules-1" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-1-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-2.png"><img class="alignnone size-thumbnail wp-image-364" title="rules-2" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-2-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-3.png"><img class="alignnone size-thumbnail wp-image-365" title="rules-3" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-3-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-4.png"><img class="alignnone size-thumbnail wp-image-366" title="rules-4" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-4-150x150.png" alt="" width="150" height="150" /></a></p>
<h3>Step 3: Create IP Filters and Associate them with the Filter List (Repeat this step until all hosts you wish to block have been entered)</h3>
<ol>
<li>Address Tab
<ul>
<li>Change Source Address to → &#8220;A specific IP Address or Subnet&#8221;</li>
<li>Enter the IP Address and/or subnet in the text box (Use <a href="http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing">CIDR syntax</a> for defining subnets (e.g. 10.10.10.0/24)</li>
<li>Check &#8220;Mirrored&#8221;</li>
</ul>
</li>
<li>Protocol Tab → Ensure protocol type is set to &#8220;Any&#8221;</li>
<li>Description Tab → Enter a description. It is typically useful to identify the creator of the rule, why it was added and a date/time when the rule was created.</li>
<li>Click &#8220;OK&#8221;</li>
<li>Repeat step 3 until all the hosts/networks you wish to block are entered. Once completed, press &#8220;OK&#8221;.</li>
</ol>
<p><a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-51.png"><img class="alignnone size-thumbnail wp-image-379" title="rules-5" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-51-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-6.png"><img class="alignnone size-thumbnail wp-image-368" title="rules-6" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-6-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-7.png"><img class="alignnone size-thumbnail wp-image-369" title="rules-7" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-7-150x150.png" alt="" width="150" height="150" /></a></p>
<h3>Step 4: Create a Filter Action</h3>
<ol>
<li>On the &#8220;Filter Action&#8221; Tab → Uncheck &#8220;Use Add Wizard&#8221; → Click &#8220;Add&#8230;&#8221;</li>
<li>On the &#8220;Security Methods&#8221; Tab → Select the &#8220;Block&#8221; radio button (All other options on this tab will become greyed out)</li>
<li>On the &#8220;General&#8221; Tab → Enter a descriptive name and description → Press &#8220;OK&#8221;</li>
</ol>
<p><a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-8.png"><img class="alignnone size-thumbnail wp-image-370" title="rules-8" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-8-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-9.png"><img class="alignnone size-thumbnail wp-image-371" title="rules-9" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-9-150x150.png" alt="" width="150" height="150" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-10.png"><img class="alignnone size-thumbnail wp-image-372" title="rules-10" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-10-150x150.png" alt="" width="150" height="150" /></a></p>
<h3>Step 5: Create Policy Rule to apply Filter Action to Filter List</h3>
<ol>
<li>On the &#8220;Filter Action&#8221; Tab, ensure the new filter action you created is selected.</li>
<li>On the &#8220;IP Filter List&#8221; Tab, ensure the new filter list you created is selected.</li>
<li>Press &#8220;OK&#8221;</li>
<li>On the new policy properties window, ensure the new list and action are enabled.</li>
<li>Press &#8220;OK&#8221;</li>
</ol>
<p><a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-11.png"><img class="alignnone size-thumbnail wp-image-373" title="rules-11" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-11-150x17.png" alt="" width="150" height="17" /></a><a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-12.png"> <img class="alignnone size-thumbnail wp-image-374" title="rules-12" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-12-150x15.png" alt="" width="150" height="15" /></a> <a href="http://halfloaded.com/wp-content/uploads/2009/12/rules-13.png"><img class="alignnone size-thumbnail wp-image-375" title="rules-13" src="http://halfloaded.com/wp-content/uploads/2009/12/rules-13-150x88.png" alt="" width="150" height="88" /></a></p>
<h3>Step 6: Assigning (and un-assigning) the Policy</h3>
<p>This step will apply all the settings you have created up to this point. <span style="color: #ff0000;"><em>Double and triple check that you did not enter a valid host or network or it will be blocked. If fact, if you have any doubts in your mind, do not do this step until another person (who knows what they are doing) looks over your work too! Note: This is one place MS will not give you a little &#8220;are you sure you want to do this&#8221; type of warning. As soon as you assign the policy, it is done.</em></span></p>
<ol>
<li>Right click your new policy → Select &#8220;Assign&#8221; → Done (It really is that easy)
<ul>
<li>To un-assign, just do the same thing except select &#8220;Un-assign&#8221; instead.</li>
</ul>
</li>
</ol>
<p><a href="http://halfloaded.com/wp-content/uploads/2009/12/assign-1.png"><img class="alignnone size-thumbnail wp-image-356" title="assign-1" src="http://halfloaded.com/wp-content/uploads/2009/12/assign-1-150x150.png" alt="" width="150" height="150" /></a></p>
<p>In part 3, I will cover how to do all this directly from the command line.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/&amp;t=Part+2%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28GUI+Edition%29" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/&amp;title=Part+2%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28GUI+Edition%29&amp;summary=In%20part%20two%2C%20I%20want%20to%20show%20how%20you%20can%20quickly%20setup%20an%20ipsec%20policy%20to%20block%20the%20bad%20hosts%20you%20identified%20in%20part%20one.%20While%20many%20methods%20can%20be%20used%20to%20block%20hosts%2C%20using%20the%20Local%20Security%20Policy%20%28secpol.msc%29%20and%20ipsec%20is%20a%20simple%20method%20which%20can%20be%20fully%20automated.%0D%0A%0D%0ABy%20following%20the%20steps%20be&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Part+2%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28GUI+Edition%29+-+http://b2l.me/b4ge7&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Part+2%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28GUI+Edition%29&amp;du=http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/&amp;cn=In%20part%20two%2C%20I%20want%20to%20show%20how%20you%20can%20quickly%20setup%20an%20ipsec%20policy%20to%20block%20the%20bad%20hosts%20you%20identified%20in%20part%20one.%20While%20many%20methods%20can%20be%20used%20to%20block%20hosts%2C%20using%20the%20Local%20Security%20Policy%20%28secpol.msc%29%20and%20ipsec%20is%20a%20simple%20method%20which%20can%20be%20fully%20automated.%0D%0A%0D%0ABy%20following%20the%20steps%20be" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/&amp;title=Part+2%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28GUI+Edition%29" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/&amp;submitHeadline=Part+2%3A+Blocking+Bad+Hosts+-+Blocking+Them%2C+Easily+%28GUI+Edition%29&amp;submitSummary=In%20part%20two%2C%20I%20want%20to%20show%20how%20you%20can%20quickly%20setup%20an%20ipsec%20policy%20to%20block%20the%20bad%20hosts%20you%20identified%20in%20part%20one.%20While%20many%20methods%20can%20be%20used%20to%20block%20hosts%2C%20using%20the%20Local%20Security%20Policy%20%28secpol.msc%29%20and%20ipsec%20is%20a%20simple%20method%20which%20can%20be%20fully%20automated.%0D%0A%0D%0ABy%20following%20the%20steps%20be&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Part%202%3A%20Blocking%20Bad%20Hosts%20-%20Blocking%20Them%2C%20Easily%20%28GUI%20Edition%29%22&amp;body=Link: http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A In%20part%20two%2C%20I%20want%20to%20show%20how%20you%20can%20quickly%20setup%20an%20ipsec%20policy%20to%20block%20the%20bad%20hosts%20you%20identified%20in%20part%20one.%20While%20many%20methods%20can%20be%20used%20to%20block%20hosts%2C%20using%20the%20Local%20Security%20Policy%20%28secpol.msc%29%20and%20ipsec%20is%20a%20simple%20method%20which%20can%20be%20fully%20automated.%0D%0A%0D%0ABy%20following%20the%20steps%20be" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/part-2-blocking-bad-hosts-blocking-them-easily-gui-edition/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Part 1: Blocking Bad Hosts &#8211; Finding Them, Easily</title>
		<link>http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/</link>
		<comments>http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/#comments</comments>
		<pubDate>Tue, 22 Dec 2009 07:19:13 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[event log]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[vbScript]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=335</guid>
		<description><![CDATA[Download Script: get-bad-hosts.zip While troubleshooting some issues on an OWA Front-End server, I went over to the security log to see if the authentication attempts were getting past this box. The problem I found was the log was so full of failed logon attempts it was difficult to filter out what I was looking for. [...]]]></description>
			<content:encoded><![CDATA[<p>Download Script: <a href="http://halfloaded.com/wp-content/uploads/2009/12/get-bad-hosts.zip">get-bad-hosts.zip</a></p>
<p>While troubleshooting some issues on an OWA Front-End server, I went over to the security log to see if the authentication attempts were getting past this box.  The problem I found was the log was so full of failed logon attempts it was difficult to filter out what I was looking for.  In a twelve hour period, there were thousands of 529 events in the security log.  Now, I know this is nothing new, but I found a few patterns.  I manually exported the log to a CSV, parsed out all the source ip addresses and opened it up in Excel.  What I found was that 98.7% of failed logon attempts were made by just four different ip addresses.  (I recommend using <a href="http://www.maxmind.com/app/locate_ip" target="_blank">MaxMind&#8217;s GeoIP Address Locator</a> for help in determining where the source addresses are located.)<span id="more-335"></span></p>
<p>The easy fix is to setup an IPSec policy to block all traffic coming from those addresses.  And I did just that.  There are many different methods to blocking bad hosts.  And, anybody who has dealt with this knows, they will come back.  Just from different addresses.</p>
<p>One other piece I was able to get from this is that there are several of our users whom have fat fingered their passwords within ActiveSync (or they just have it setup wrong).  And then there are those users who have forgotten their domain, e-mail address, username, etc.</p>
<p>This is step one in my project to automate the blocking of bad hosts.  My goal is to build an automated method for blocking hosts with a high percentage of bad logon attempts within <em>n</em> hours.  And, even if I can&#8217;t get it 100% automated, this first whack at it took my bad logon attempts from 800 per hour to 25 per hour; nearly a 97% improvement!  And, a lot less crap to sift through when troubleshooting real issues.</p>
<p>So, my first goal is to automate a method of extracting the data I want from the event log.  (The script can be found below.)  The most important piece of data is the source ip address.  However, the other pieces of data I decided to extract could be helpful in determining the legitimacy of the logon failure.</p>
<p>To get the data, simply download the script and run &#8220;cscript /nologo get-bad-hosts.vbs &gt; bad-hosts.csv&#8221; (w/o the quotes).  You can then open the file in Excel, do a quick pivot-table and identify the source addresses with the most hits.  At that point, you can add the host (or address block) to an ipsec policy to block all traffic from that address.</p>
<p>In my next post, I&#8217;ll explain the details in setting up a quick ipsec policy to block the bad guys.  Cheers!</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">'==========================================================================</span>
<span style="color: #008080; font-style: italic;">' VBScript Source File</span>
<span style="color: #008080; font-style: italic;">' NAME: get-bad-hosts.vbs</span>
<span style="color: #008080; font-style: italic;">' AUTHOR: Andrew J Healey</span>
<span style="color: #008080; font-style: italic;">' WEB: http://halfloaded.com/</span>
<span style="color: #008080; font-style: italic;">' DATE  : Dec 21 2009</span>
<span style="color: #008080; font-style: italic;">' COMMENT: This script will return data in csv format for use in determining</span>
<span style="color: #008080; font-style: italic;">'	hack, lockout or bad logon attempts</span>
<span style="color: #008080; font-style: italic;">' PROCESS: 1) query event log for event id 529; 2) parse data to return</span>
<span style="color: #008080; font-style: italic;">'	useful data; 3) output to screen</span>
<span style="color: #008080; font-style: italic;">' USAGE: cscript /nologo get-bad-hosts.vbs c:\bad-hosts.csv</span>
<span style="color: #008080; font-style: italic;">'==========================================================================</span>
&nbsp;
<span style="color: #FF8000;">Option</span> Explicit
<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
&nbsp;
<span style="color: #0600FF;">Dim</span> strComputer, objWMIService, colLoggedEvents
<span style="color: #0600FF;">Dim</span> objEvent, objRegEx, colMatches, strMatch
<span style="color: #0600FF;">Dim</span> strUserName, strWorkstation, strIPAddress, strDomain
&nbsp;
<span style="color: #008080; font-style: italic;">'Change to name of computer to query remote machine</span>
strComputer <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;.&quot;</span>
<span style="color: #FF8000;">Set</span> objWMIService <span style="color: #008000;">=</span> GetObject<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;winmgmts:&quot;</span> _
    <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;{impersonationLevel=impersonate}!\\&quot;</span> <span style="color: #008000;">&amp;</span>amp; strComputer <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;\root\cimv2&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Event 529 in the security log are &quot;Failure Audit&quot; for a &quot;Logon/Logoff&quot;</span>
<span style="color: #FF8000;">Set</span> colLoggedEvents <span style="color: #008000;">=</span> objWMIService.<span style="color: #0000FF;">ExecQuery</span> _
        <span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Select * from Win32_NTLogEvent Where Logfile = 'Security' and &quot;</span> _
            <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;EventCode = '529'&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Write header to screen</span>
wscript.<span style="color: #0000FF;">echo</span> <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;User Name&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Workstation&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Source IP&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Windows Domain&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
			 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Date/Time&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Loop through all events matching criteria above: 529 in sec log</span>
<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> objEvent in colLoggedEvents
	<span style="color: #008080; font-style: italic;">'Use regex to parse any ip addresses from event</span>
	<span style="color: #008080; font-style: italic;">' if no address found, goto next record</span>
	<span style="color: #FF8000;">Set</span> objRegEx <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;VBScript.RegExp&quot;</span><span style="color: #000000;">&#41;</span>
	objRegEx.<span style="color: #0000FF;">Global</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
	objRegEx.<span style="color: #0000FF;">IgnoreCase</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the user name that was used</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;(\tUser Name:.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strUserName <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the workstation name that was used</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;(\tWorkstation Name:.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strWorkstation <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the source ip address</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;(\tSource Network Address:.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strIPAddress <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Will return the line of the domain that was used</span>
	objRegEx.<span style="color: #0000FF;">Pattern</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;\tDomain:(.*\n)&quot;</span>
	<span style="color: #FF8000;">Set</span> colMatches <span style="color: #008000;">=</span> objRegEx.<span style="color: #0000FF;">Execute</span><span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">Message</span><span style="color: #000000;">&#41;</span>
	<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> strMatch in colMatches
	   strDomain <span style="color: #008000;">=</span> strMatch.<span style="color: #0000FF;">Value</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #008080; font-style: italic;">'Output clean csv line for easy reading in spreadsheet program</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strUserName<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strWorkstation<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strIpAddress<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; GetCleanText<span style="color: #000000;">&#40;</span>strDomain<span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;,&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
				 <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; WMIDateStringToDate<span style="color: #000000;">&#40;</span>objEvent.<span style="color: #0000FF;">TimeWritten</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">chr</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">34</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">Next</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> GetCleanText<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">byVal</span> strText<span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'This will cleanup the text and return only necessary data</span>
	<span style="color: #008080; font-style: italic;">' I'm sure there is a better way to do this :)</span>
	<span style="color: #0600FF;">dim</span> tmp,txt
	tmp <span style="color: #008000;">=</span> <span style="color: #0600FF;">Split</span><span style="color: #000000;">&#40;</span>strText,<span style="color: #808080;">&quot;:&quot;</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> tmp<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> <span style="color: #0600FF;">Replace</span><span style="color: #000000;">&#40;</span>txt,vbTab,<span style="color: #808080;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> <span style="color: #0600FF;">Replace</span><span style="color: #000000;">&#40;</span>txt,vbCrLf,<span style="color: #808080;">&quot;&quot;</span><span style="color: #000000;">&#41;</span>
	txt <span style="color: #008000;">=</span> <span style="color: #0600FF;">Trim</span><span style="color: #000000;">&#40;</span>txt<span style="color: #000000;">&#41;</span>
	GetCleanText <span style="color: #008000;">=</span> txt
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> WMIDateStringToDate<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">byVal</span> dtmEventDate<span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Borrowed from the &quot;Hey, Scripting Guy! BLOG&quot;</span>
	<span style="color: #008080; font-style: italic;">' --&amp;gt; Search: WMIDateStringToDate</span>
    WMIDateStringToDate <span style="color: #008000;">=</span> <span style="color: #0600FF;">CDate</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">5</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;/&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
        <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">7</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;/&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">Left</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">4</span><span style="color: #000000;">&#41;</span> _
            <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot; &quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #FF8000;">Mid</span> <span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">9</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;:&quot;</span> <span style="color: #008000;">&amp;</span>amp; _
                <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, <span style="color: #FF0000;">11</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;:&quot;</span> <span style="color: #008000;">&amp;</span>amp; <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>dtmEventDate, _
                    <span style="color: #FF0000;">13</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;t=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;title=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily&amp;summary=Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily+-+http://b2l.me/b4ge9&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily&amp;du=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;cn=Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;title=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;submitHeadline=Part+1%3A+Blocking+Bad+Hosts+-+Finding+Them%2C+Easily&amp;submitSummary=Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Part%201%3A%20Blocking%20Bad%20Hosts%20-%20Finding%20Them%2C%20Easily%22&amp;body=Link: http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Download%20Script%3A%20get-bad-hosts.zip%0D%0A%0D%0AWhile%20troubleshooting%20some%20issues%20on%20an%20OWA%20Front-End%20server%2C%20I%20went%20over%20to%20the%20security%20log%20to%20see%20if%20the%20authentication%20attempts%20were%20getting%20past%20this%20box.%20%20The%20problem%20I%20found%20was%20the%20log%20was%20so%20full%20of%20failed%20logon%20attempts%20it%20was%20difficult%20to%20filter%20out%20w" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/part-1-blocking-bad-hosts-finding-them-easily/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logon Script: Move Local PST Files To Network Share</title>
		<link>http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/</link>
		<comments>http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/#comments</comments>
		<pubDate>Thu, 15 Oct 2009 03:25:05 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[logon script]]></category>
		<category><![CDATA[outlook]]></category>
		<category><![CDATA[pst]]></category>
		<category><![CDATA[vbScript]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=322</guid>
		<description><![CDATA[Download Script: move-pst-to-network.zip So, my buddy (and former co-worker) called me yesterday for some help with a script he put together.  His script checked the local profile in Outlook for any PST files that were stored locally.  If it found any, it would them move them to the users home space.  We tried and tried [...]]]></description>
			<content:encoded><![CDATA[<p>Download Script: <a href="http://halfloaded.com/wp-content/uploads/2009/10/move-pst-to-network.zip">move-pst-to-network.zip</a></p>
<p>So, my buddy (and former co-worker) called me yesterday for some help with a script he put together.  His script checked the local profile in Outlook for any PST files that were stored locally.  If it found any, it would them move them to the users home space.  We tried and tried to get the script to work properly but it never seemed to work 100%.  Being that he is a good friend and this would be useful at work, I decided to take the work he had put in and get the thing working.<span id="more-322"></span></p>
<p>Here is what the script does:</p>
<ol>
<li>Checks to see if the computer is a laptop.  If it is, the user probably uses Outlook offline and/or over VPN so moving the PST to a network share will be detrimental to the user&#8217;s experience.  If you don&#8217;t care, just comment out lines 17-21.</li>
<li>Checks to see if Outlook is installed and can be launched properly.  If it can not, no sense in continuing the script.  It will exit.</li>
<li>Checks to see that the target (network) directory exists and is writable.  If it does not exist or is not writable, the script will exit.</li>
<li>Enumerates all the local stores and returns all the PST files.</li>
<li>Check to see if the PST files are stored on local drives.  It will exclude drives that are mapped network drives and/or removable media.</li>
<li>Check if a file already exists in the target directory with the same name.  If one does, it will not copy the file over. (I may update the script to move and rename the file to ensure all local PSTs are moved.</li>
<li>Removes all Personal Folders from Outlook that matched criteria.</li>
<li>Moves actual PST files to network share (Outlook will close to release the file lock on the PST file).</li>
<li>Adds all the Personal Folders back to Outlook.</li>
</ol>
<p>I have tested this on Windows XP w/ Office 2007 and Office 2003.  I am interested in hearing if this works or not in your environment.  I hope you find this useful.</p>

<div class="wp_syntax"><div class="code"><pre class="vbnet" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">'==========================================================================</span>
<span style="color: #008080; font-style: italic;">' VBScript Source File</span>
<span style="color: #008080; font-style: italic;">' NAME: move-pst-to-network</span>
<span style="color: #008080; font-style: italic;">' AUTHOR: Andrew J Healey &amp;amp; Nate Stevenson</span>
<span style="color: #008080; font-style: italic;">' WEB: http://halfloaded.com/</span>
<span style="color: #008080; font-style: italic;">' DATE  : 2010.14.2009</span>
<span style="color: #008080; font-style: italic;">' COMMENT: This script will move any mapped PST files that are located on</span>
<span style="color: #008080; font-style: italic;">'	local disks to a network share.</span>
<span style="color: #008080; font-style: italic;">' PROCESS: 1) determine if laptop; 2) determine if outlook installed</span>
<span style="color: #008080; font-style: italic;">'	3) determine local drives; 4) check for local pst's; 5) move pst's</span>
<span style="color: #008080; font-style: italic;">'	to network; 6) remap pst files</span>
<span style="color: #008080; font-style: italic;">'==========================================================================</span>
&nbsp;
<span style="color: #FF8000;">Option</span> Explicit
&nbsp;
<span style="color: #008080; font-style: italic;">'Determine if a laptop (remove if you don't care)</span>
<span style="color: #0600FF;">If</span> IsLaptop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span> <span style="color: #FF8000;">Then</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;Computer is a laptop or the chassis could not be determined.&quot;</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;Exiting.&quot;</span>
	wscript.<span style="color: #0000FF;">quit</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Determine if outlook is installed</span>
<span style="color: #0600FF;">If</span> IsOutlookInstalled<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span> <span style="color: #FF8000;">Then</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;Could not launch Outlook.&quot;</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;Exiting.&quot;</span>
	wscript.<span style="color: #0000FF;">quit</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Get user name</span>
<span style="color: #0600FF;">Dim</span> WshNetwork : <span style="color: #FF8000;">Set</span> WshNetwork <span style="color: #008000;">=</span> WScript.<span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;WScript.Network&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #0600FF;">Dim</span> user : user <span style="color: #008000;">=</span> <span style="color: #0600FF;">lcase</span><span style="color: #000000;">&#40;</span>WshNetwork.<span style="color: #0000FF;">UserName</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">Set</span> WshNetwork <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
&nbsp;
<span style="color: #0600FF;">Dim</span> strNetworkPath
<span style="color: #008080; font-style: italic;">'=========================================================================</span>
<span style="color: #008080; font-style: italic;">' Configuration Section</span>
strNetworkPath <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;\\servername\homes\&quot;</span> <span style="color: #008000;">&amp;</span>amp; user <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;\&quot;</span>
<span style="color: #008080; font-style: italic;">' End Configuration Section</span>
<span style="color: #008080; font-style: italic;">'=========================================================================</span>
<span style="color: #008080; font-style: italic;">'Fix network path if forgot to include trailing slash...</span>
<span style="color: #0600FF;">If</span> <span style="color: #804040;">Not</span> <span style="color: #0600FF;">Right</span><span style="color: #000000;">&#40;</span>strNetworkPath,<span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;\&quot;</span> <span style="color: #FF8000;">Then</span> strNetworkPath <span style="color: #008000;">=</span> strNetworkPath <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;\&quot;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Determine if network path is writable</span>
<span style="color: #0600FF;">If</span> IsPathWritable<span style="color: #000000;">&#40;</span>strNetworkPath<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span> <span style="color: #FF8000;">Then</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;Remote path is not writable.&quot;</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;Exiting.&quot;</span>
	wscript.<span style="color: #0000FF;">quit</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Instatiate objects</span>
<span style="color: #0600FF;">Dim</span> objOutlook, objNS, objFSO, objFolder
<span style="color: #FF8000;">Set</span> objOutlook <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Outlook.Application&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">Set</span> objNS <span style="color: #008000;">=</span> objOutlook.<span style="color: #0000FF;">GetNamespace</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;MAPI&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">Set</span> objFSO <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Sort through all stores in outlook and add all local pst</span>
<span style="color: #008080; font-style: italic;">' paths into an array. Then remove the store from outlook.</span>
<span style="color: #0600FF;">Dim</span> pstFiles
<span style="color: #0600FF;">Dim</span> count : count <span style="color: #008000;">=</span> <span style="color: #008000;">-</span><span style="color: #FF0000;">1</span>
<span style="color: #0600FF;">Dim</span> arrPaths<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> objFolder In objNS.<span style="color: #008000;">Folders</span>
	<span style="color: #0600FF;">If</span> GetPSTPath<span style="color: #000000;">&#40;</span>objFolder.<span style="color: #0000FF;">StoreID</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>lt;<span style="color: #008000;">&amp;</span>gt; <span style="color: #808080;">&quot;&quot;</span> <span style="color: #FF8000;">Then</span>
		pstFiles <span style="color: #008000;">=</span> GetPSTPath<span style="color: #000000;">&#40;</span>objFolder.<span style="color: #0000FF;">StoreID</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">If</span> IsStoredLocal<span style="color: #000000;">&#40;</span>pstFiles<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span> <span style="color: #FF8000;">Then</span>
			<span style="color: #0600FF;">If</span> objFSO.<span style="color: #0000FF;">FileExists</span><span style="color: #000000;">&#40;</span>strNetworkPath <span style="color: #008000;">&amp;</span>amp; <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>pstFiles,<span style="color: #0600FF;">InStrRev</span><span style="color: #000000;">&#40;</span>pstFiles,<span style="color: #808080;">&quot;\&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span> <span style="color: #FF8000;">Then</span>
				wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;A pst file already exists with the same name.&quot;</span> <span style="color: #008000;">&amp;</span>amp; vbCrLf <span style="color: #008000;">&amp;</span>amp; _
						vbTab <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Source: &quot;</span> <span style="color: #008000;">&amp;</span>amp; pstPath <span style="color: #008000;">&amp;</span>amp; vbCrLf <span style="color: #008000;">&amp;</span>amp; _
						vbTab <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;Target: &quot;</span> <span style="color: #008000;">&amp;</span>amp; strNetworkPath <span style="color: #008000;">&amp;</span>amp; <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>pstPath,<span style="color: #0600FF;">InStrRev</span><span style="color: #000000;">&#40;</span>pstPath,<span style="color: #808080;">&quot;\&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
			<span style="color: #FF8000;">Else</span>
				count <span style="color: #008000;">=</span> count <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span>
				<span style="color: #0600FF;">ReDim</span> Preserve arrPaths<span style="color: #000000;">&#40;</span>count<span style="color: #000000;">&#41;</span>
				arrPaths<span style="color: #000000;">&#40;</span>count<span style="color: #000000;">&#41;</span> <span style="color: #008000;">=</span> pstFiles
				objOutlook.<span style="color: #0000FF;">Session</span>.<span style="color: #0000FF;">RemoveStore</span> objFolder
			<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
	<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
<span style="color: #FF8000;">Next</span>
&nbsp;
objOutlook.<span style="color: #0000FF;">Session</span>.<span style="color: #0000FF;">Logoff</span>
objOutlook.<span style="color: #0000FF;">Quit</span>
<span style="color: #FF8000;">Set</span> objOutlook <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
<span style="color: #FF8000;">Set</span> objNS <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
&nbsp;
<span style="color: #0600FF;">if</span> count <span style="color: #008000;">&amp;</span>lt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">then</span>
	wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;No local PST Files Found.&quot;</span>
	wscript.<span style="color: #0000FF;">quit</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'If local PST files were found, move them to the new location</span>
<span style="color: #008080; font-style: italic;">' Echo output if the file already exists</span>
<span style="color: #0600FF;">Dim</span> pstPath
<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> pstPath in arrPaths
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		objFSO.<span style="color: #0000FF;">MoveFile</span> pstPath, strNetworkPath
		<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> <span style="color: #008000;">&amp;</span>lt;<span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span>
			wscript.<span style="color: #0000FF;">sleep</span> <span style="color: #FF0000;">5000</span>
			objFSO.<span style="color: #0000FF;">MoveFile</span> pstPath, strNetworkPath
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
	<span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Clear</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
<span style="color: #FF8000;">Next</span>
<span style="color: #FF8000;">Set</span> objFSO <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Re-open outlook</span>
<span style="color: #FF8000;">Set</span> objOutlook <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Outlook.Application&quot;</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">Set</span> objNS <span style="color: #008000;">=</span> objOutlook.<span style="color: #0000FF;">GetNamespace</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;MAPI&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
<span style="color: #008080; font-style: italic;">'Re-map Outlook folders</span>
<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> pstPath in arrPaths
	objNS.<span style="color: #0000FF;">AddStore</span> strNetworkPath <span style="color: #008000;">&amp;</span>amp; <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>pstPath,<span style="color: #0600FF;">InStrRev</span><span style="color: #000000;">&#40;</span>pstPath,<span style="color: #808080;">&quot;\&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
<span style="color: #FF8000;">Next</span>
&nbsp;
objOutlook.<span style="color: #0000FF;">Session</span>.<span style="color: #0000FF;">Logoff</span>
objOutlook.<span style="color: #0000FF;">Quit</span>
<span style="color: #FF8000;">Set</span> objOutlook <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
<span style="color: #FF8000;">Set</span> objNS <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
wscript.<span style="color: #0000FF;">echo</span> <span style="color: #808080;">&quot;Done.&quot;</span>
wscript.<span style="color: #0000FF;">quit</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> GetPSTPath<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">byVal</span> <span style="color: #FF8000;">input</span><span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Will return the path of all PST files</span>
	<span style="color: #008080; font-style: italic;">' Took Function from: http://www.vistax64.com/vb-script/</span>
	<span style="color: #0600FF;">Dim</span> i, strSubString, strPath
	<span style="color: #FF8000;">For</span> i <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span> <span style="color: #FF8000;">To</span> <span style="color: #FF8000;">Len</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">input</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Step</span> <span style="color: #FF0000;">2</span>
		strSubString <span style="color: #008000;">=</span> <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span><span style="color: #FF8000;">input</span>,i,<span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">If</span> <span style="color: #804040;">Not</span> strSubString <span style="color: #008000;">=</span> <span style="color: #808080;">&quot;00&quot;</span> <span style="color: #FF8000;">Then</span>
			strPath <span style="color: #008000;">=</span> strPath <span style="color: #008000;">&amp;</span>amp; <span style="color: #0600FF;">ChrW</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;&amp;amp;H&quot;</span> <span style="color: #008000;">&amp;</span>amp; strSubString<span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
	<span style="color: #FF8000;">Next</span>
&nbsp;
	<span style="color: #0600FF;">Select</span> <span style="color: #0600FF;">Case</span> <span style="color: #0600FF;">True</span>
		<span style="color: #0600FF;">Case</span> <span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strPath,<span style="color: #808080;">&quot;:\&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span>
			GetPSTPath <span style="color: #008000;">=</span> <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>strPath,<span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strPath,<span style="color: #808080;">&quot;:\&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">-</span><span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">Case</span> <span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strPath,<span style="color: #808080;">&quot;\\&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span>
			GetPSTPath <span style="color: #008000;">=</span> <span style="color: #FF8000;">Mid</span><span style="color: #000000;">&#40;</span>strPath,<span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>strPath,<span style="color: #808080;">&quot;\\&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Select</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> IsLaptop<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Determine if the computer is a mobile machine</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #008080; font-style: italic;">'Instantiate objects</span>
		<span style="color: #0600FF;">Dim</span> objWMIService, colChassis, objChassis, strChassisType
		<span style="color: #FF8000;">Set</span> objWMIService <span style="color: #008000;">=</span> GetObject<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #FF8000;">Set</span> colChassis <span style="color: #008000;">=</span> objWMIService.<span style="color: #0000FF;">ExecQuery</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Select * from Win32_SystemEnclosure&quot;</span><span style="color: #000000;">&#41;</span>
&nbsp;
		<span style="color: #008080; font-style: italic;">'Check chassis type</span>
		<span style="color: #008080; font-style: italic;">'http://msdn.microsoft.com/en-us/library/aa394474%28VS.85%29.aspx</span>
		<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> objChassis in colChassis
			<span style="color: #FF8000;">For</span>  <span style="color: #0600FF;">Each</span> strChassisType in objChassis.<span style="color: #0000FF;">ChassisTypes</span>
				<span style="color: #0600FF;">If</span> <span style="color: #000000;">&#40;</span>strChassisType <span style="color: #008000;">&amp;</span>gt;<span style="color: #008000;">=</span> <span style="color: #FF0000;">8</span> <span style="color: #804040;">And</span> strChassisType <span style="color: #008000;">&amp;</span>lt;<span style="color: #008000;">=</span><span style="color: #FF0000;">12</span><span style="color: #000000;">&#41;</span> Or <span style="color: #000000;">&#40;</span>strChassisType <span style="color: #008000;">=</span> <span style="color: #FF0000;">14</span><span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Then</span>
					IsLaptop <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
					<span style="color: #0600FF;">Exit</span> <span style="color: #FF8000;">For</span>
				<span style="color: #FF8000;">Else</span>
					IsLaptop <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
				<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
			<span style="color: #FF8000;">Next</span>
		<span style="color: #FF8000;">Next</span>
	<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> <span style="color: #008000;">&amp;</span>lt;<span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span> IsLaptop <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
	<span style="color: #FF8000;">Set</span> colChassis <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	<span style="color: #FF8000;">Set</span> objWMIService <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	objChassis <span style="color: #008000;">=</span> <span style="color: #FF8000;">Null</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span> 
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> IsOutlookInstalled<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Function will return false if unable to launch outlook</span>
	<span style="color: #008080; font-style: italic;">' This adds some overhead but it is ultimately the best</span>
	<span style="color: #008080; font-style: italic;">' way to truly determine if script will function properly.</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #FF8000;">Set</span> objOutlook <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Outlook.Application&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> <span style="color: #008000;">&amp;</span>lt;<span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span>
			IsOutlookInstalled <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
			<span style="color: #0600FF;">Exit</span> <span style="color: #0600FF;">Function</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
	IsOutlookInstalled <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
	objOutlook.<span style="color: #0000FF;">Session</span>.<span style="color: #0000FF;">Logoff</span>
	objOutlook.<span style="color: #0000FF;">Quit</span>
	<span style="color: #FF8000;">Set</span> objOutlook <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> IsPathWritable<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">byVal</span> strPath<span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Check to make sure the path is writable. If it is not, no</span>
	<span style="color: #008080; font-style: italic;">' need to continue processing.</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #FF8000;">Set</span> objFSO <span style="color: #008000;">=</span> <span style="color: #0600FF;">CreateObject</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Scripting.FileSystemObject&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">Dim</span> min : min <span style="color: #008000;">=</span> <span style="color: #FF0000;">1</span>
		<span style="color: #0600FF;">Dim</span> max : max <span style="color: #008000;">=</span> <span style="color: #FF0000;">1000</span>
		<span style="color: #0600FF;">Dim</span> rand : rand <span style="color: #008000;">=</span> <span style="color: #0600FF;">Int</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span>max <span style="color: #008000;">-</span> min <span style="color: #008000;">+</span> <span style="color: #FF0000;">1</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">*</span> <span style="color: #0600FF;">Rnd</span> <span style="color: #008000;">+</span> min<span style="color: #000000;">&#41;</span>
		<span style="color: #0600FF;">Dim</span> fullFileName : fullFileName <span style="color: #008000;">=</span> strPath <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;temporary-&quot;</span> <span style="color: #008000;">&amp;</span>amp; rand <span style="color: #008000;">&amp;</span>amp; <span style="color: #808080;">&quot;.txt&quot;</span>
		<span style="color: #0600FF;">Dim</span> objFile : <span style="color: #FF8000;">Set</span> objFile <span style="color: #008000;">=</span> objFSO.<span style="color: #0000FF;">CreateTextFile</span><span style="color: #000000;">&#40;</span>fullFileName, <span style="color: #0600FF;">True</span><span style="color: #000000;">&#41;</span>
		objFile.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;Test file creation of &quot;</span> <span style="color: #008000;">&amp;</span>amp; fullFileName<span style="color: #000000;">&#41;</span>
		objFile.<span style="color: #0600FF;">Close</span>
		<span style="color: #0600FF;">If</span> objFSO.<span style="color: #0000FF;">FileExists</span><span style="color: #000000;">&#40;</span>fullFileName<span style="color: #000000;">&#41;</span> <span style="color: #FF8000;">Then</span>
			IsPathWritable <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
			objFSO.<span style="color: #0000FF;">DeleteFile</span><span style="color: #000000;">&#40;</span>fullFileName<span style="color: #000000;">&#41;</span>
		<span style="color: #FF8000;">Else</span>
			IsPathWritable <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
		<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
	<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> <span style="color: #008000;">&amp;</span>lt;<span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span> IsPathWritable <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
	<span style="color: #FF8000;">Set</span> objFile <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	<span style="color: #FF8000;">Set</span> objFSO <span style="color: #008000;">=</span> <span style="color: #FF8000;">Nothing</span>
	rand <span style="color: #008000;">=</span> <span style="color: #FF8000;">Null</span>
	max <span style="color: #008000;">=</span> <span style="color: #FF8000;">Null</span>
	min <span style="color: #008000;">=</span> <span style="color: #FF8000;">Null</span>
	fullFileName <span style="color: #008000;">=</span> <span style="color: #FF8000;">Null</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span>
&nbsp;
<span style="color: #FF8000;">Private</span> <span style="color: #0600FF;">Function</span> IsStoredLocal<span style="color: #000000;">&#40;</span><span style="color: #FF8000;">ByVal</span> fullFileName<span style="color: #000000;">&#41;</span>
	<span style="color: #008080; font-style: italic;">'Check if the PST is stored locally or on a mapped or removable drive</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> <span style="color: #FF8000;">Resume</span> <span style="color: #FF8000;">Next</span>
		<span style="color: #0600FF;">Dim</span> objDisk, objWMIService, colDisks
		<span style="color: #FF8000;">Set</span> objWMIService <span style="color: #008000;">=</span> GetObject<span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #FF8000;">Set</span> colDisks <span style="color: #008000;">=</span> objWMIService.<span style="color: #0000FF;">ExecQuery</span><span style="color: #000000;">&#40;</span><span style="color: #808080;">&quot;SELECT * FROM Win32_LogicalDisk&quot;</span><span style="color: #000000;">&#41;</span>
		<span style="color: #FF8000;">For</span> <span style="color: #0600FF;">Each</span> objDisk in colDisks
			<span style="color: #0600FF;">If</span> objDisk.<span style="color: #0000FF;">DriveType</span> <span style="color: #008000;">=</span> <span style="color: #FF0000;">3</span> <span style="color: #FF8000;">Then</span>
				<span style="color: #0600FF;">If</span> <span style="color: #0600FF;">InStr</span><span style="color: #000000;">&#40;</span>fullFileName,objDisk.<span style="color: #0000FF;">DeviceID</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span>
					IsStoredLocal <span style="color: #008000;">=</span> <span style="color: #0600FF;">True</span>
					<span style="color: #0600FF;">Exit</span> <span style="color: #FF8000;">For</span>
				<span style="color: #FF8000;">Else</span>
					IsStoredLocal <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
				<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
			<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">If</span>
		<span style="color: #FF8000;">Next</span>
	<span style="color: #0600FF;">If</span> <span style="color: #008000;">Err</span>.<span style="color: #0000FF;">Number</span> <span style="color: #008000;">&amp;</span>lt;<span style="color: #008000;">&amp;</span>gt; <span style="color: #FF0000;">0</span> <span style="color: #FF8000;">Then</span> IsLocalDrive <span style="color: #008000;">=</span> <span style="color: #0600FF;">False</span>
	<span style="color: #FF8000;">On</span> <span style="color: #FF8000;">Error</span> GoTo <span style="color: #FF0000;">0</span>
<span style="color: #0600FF;">End</span> <span style="color: #0600FF;">Function</span></pre></div></div>



<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/&amp;t=Logon+Script%3A+Move+Local+PST+Files+To+Network+Share" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/&amp;title=Logon+Script%3A+Move+Local+PST+Files+To+Network+Share&amp;summary=Download%20Script%3A%20move-pst-to-network.zip%0D%0A%0D%0ASo%2C%20my%20buddy%20%28and%20former%20co-worker%29%20called%20me%20yesterday%20for%20some%20help%20with%20a%20script%20he%20put%20together.%C2%A0%20His%20script%20checked%20the%20local%20profile%20in%20Outlook%20for%20any%20PST%20files%20that%20were%20stored%20locally.%C2%A0%20If%20it%20found%20any%2C%20it%20would%20them%20move%20them%20to%20the%20users%20home%20&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Logon+Script%3A+Move+Local+PST+Files+To+Network+Share+-+http://b2l.me/b4gey&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Logon+Script%3A+Move+Local+PST+Files+To+Network+Share&amp;du=http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/&amp;cn=Download%20Script%3A%20move-pst-to-network.zip%0D%0A%0D%0ASo%2C%20my%20buddy%20%28and%20former%20co-worker%29%20called%20me%20yesterday%20for%20some%20help%20with%20a%20script%20he%20put%20together.%C2%A0%20His%20script%20checked%20the%20local%20profile%20in%20Outlook%20for%20any%20PST%20files%20that%20were%20stored%20locally.%C2%A0%20If%20it%20found%20any%2C%20it%20would%20them%20move%20them%20to%20the%20users%20home%20" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/&amp;title=Logon+Script%3A+Move+Local+PST+Files+To+Network+Share" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/&amp;submitHeadline=Logon+Script%3A+Move+Local+PST+Files+To+Network+Share&amp;submitSummary=Download%20Script%3A%20move-pst-to-network.zip%0D%0A%0D%0ASo%2C%20my%20buddy%20%28and%20former%20co-worker%29%20called%20me%20yesterday%20for%20some%20help%20with%20a%20script%20he%20put%20together.%C2%A0%20His%20script%20checked%20the%20local%20profile%20in%20Outlook%20for%20any%20PST%20files%20that%20were%20stored%20locally.%C2%A0%20If%20it%20found%20any%2C%20it%20would%20them%20move%20them%20to%20the%20users%20home%20&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Logon%20Script%3A%20Move%20Local%20PST%20Files%20To%20Network%20Share%22&amp;body=Link: http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A Download%20Script%3A%20move-pst-to-network.zip%0D%0A%0D%0ASo%2C%20my%20buddy%20%28and%20former%20co-worker%29%20called%20me%20yesterday%20for%20some%20help%20with%20a%20script%20he%20put%20together.%C2%A0%20His%20script%20checked%20the%20local%20profile%20in%20Outlook%20for%20any%20PST%20files%20that%20were%20stored%20locally.%C2%A0%20If%20it%20found%20any%2C%20it%20would%20them%20move%20them%20to%20the%20users%20home%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/logon-script-move-local-pst-files-to-network-share/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Unexplained Phenomenom: Google&#8217;s Doodle Gogle</title>
		<link>http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/</link>
		<comments>http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 18:00:39 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19]]></category>
		<category><![CDATA[all your base o are belong to us]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[go_gle]]></category>
		<category><![CDATA[O]]></category>
		<category><![CDATA[unexplained phenomenom]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=305</guid>
		<description><![CDATA[Okay, okay.  I know you are expecting another brain-dead response to Go_gle&#8217;s recent doodle.  However, I am sick of it and I want to debunk several of the pages that say they have solved the mystery.  Here are a few interesting events: Go_gle posted &#8220;1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19&#8243; on its Twitter Page.  [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_307" class="wp-caption alignright" style="width: 308px"><img class="size-full wp-image-307" title="Unexplained-Phenomenon" src="http://halfloaded.com/wp-content/uploads/2009/09/Unexplained-Phenomenon.jpg" alt="NOOO!!!!  Not my O!" width="298" height="149" /><p class="wp-caption-text">NOOO!!!!  Not my O!</p></div>
<p>Okay, okay.  I know you are expecting another brain-dead response to Go_gle&#8217;s recent doodle.  However, I am sick of it and I want to debunk several of the pages that say they have solved the mystery.  Here are a few interesting events:<span id="more-305"></span></p>
<ol>
<li>Go_gle posted &#8220;1.12.12 25.15.21.18 15 1.18.5 2.5.12.15.14.7 20.15 21.19&#8243; on its <a href="http://twitter.com/GOOGLE" target="_blank">Twitter Page</a>.  It is a <a href="http://en.wikipedia.org/wiki/All_your_base_are_belong_to_us#In_popular_culture">straight alpha-numeric transliteration</a> meaning, A=1, B=2, etc and making it stand for: &#8220;All Your O Are Belong To Us&#8221;.</li>
<li>The Go_gle logo file has been renamed with a missing O.  The actual file path is: <a href="http://www.google.com/logos/go_gle.gif">http://www.google.com/logos/go_gle.gif</a></li>
<li>The UFO is abducting the O.  The filename and the twitter post confirm there is something special about the O or about it going missing.</li>
<li><a href="http://www.urbandictionary.com/define.php?term=gogle" target="_blank">Gogle according to the urban dictionary</a>: a group of people awkwardly waiting for something to happen; usually unfamiliar with each other; a pre-icebreaker group</li>
<li>Go_gle has gone to great lengths to make this work in many countries.  However, not all have had their logo&#8217;s changed.  For instance, the Spain (although Spanish speaking Latin American countries have) and India Go_gle Search pages have not been changed.
<ol>
<li><a href="http://www.google.ru/">Russian Go_gle Page</a>.  Search Term: необъяснимые явления</li>
<li><a href="http://www.google.de/">Germany Go_gle Page</a>.  Search Term: Rätselhaftes Phänomen</li>
<li><a href="http://www.google.com.mx/">Mexico Go_gle Page</a>.  Search Term: fenómenos inexplicables</li>
<li><a href="http://www.google.nl/">Netherlands Go_gle Page</a>. Search Term: onverklaarbare verschijning</li>
<li><a href="http://www.google.hu/">Hungary Go_gle Page</a>. Search Term: megmagyarázhatatlan rejtélyek</li>
<li><a href="http://www.google.it/">Italy Go_gle Page</a>. Search Term: misteri inspiegabili</li>
</ol>
</li>
<li>As the 6th of September comes to countries, Go_gle is pulling the logo.  So, there is something specific with the 5th.</li>
</ol>
<p>Here are some of the rumors that people are spreading.  Of course, I have no proof&#8230; Only common sense.</p>
<ul>
<li>Reference to UFO Festival in Exeter, NH &#8212; Nope.  Why would Go_gle change the logo all across the world?  It is out of character for Go_gle to link to such an obscure search phrase.  Also, the <a href="http://en.wikipedia.org/wiki/Exeter_incident" target="_blank">Exeter incident happened in the weeks leading up to Sept 3rd, 1965</a>.</li>
<li>Reference to <a href="http://en.wikipedia.org/wiki/Voyager_I">Voyager I</a> (Sept 5, 1977) &#8212; Nope.  Although probably the most relevant space/UFO event relating to Sept 5th, Go_gle would probably just use the search phrase: Voyager Spacecraft.</li>
<li>Maiden return landing of Space Shuttle Discovery (Sept 5, 1984) &#8212; Nope.  Once again, when Go_gle marks important events for mankind, they are more specific with their search phrase.</li>
<li><a href="http://www.mirror.co.uk/news/top-stories/2009/09/05/wife-of-japan-s-prime-minister-claims-she-was-abducted-by-aliens-115875-21649309/">Japan&#8217;s New Prime Minister&#8217;s Wife Visits Venus</a> &#8212; Nope.  I really doubt Go_gle wants to make a statement that could be viewed as politically motivated or could look like Go_gle is poking fun at a foreign dignitary.  It just doesn&#8217;t make sense for Go_gle to do this.  Plus, the <a href="http://www.google.co.jp/" target="_blank">Japan Go_gle Search Page</a> doesn&#8217;t show the logo.</li>
<li>British Release of &#8220;<a href="http://en.wikipedia.org/wiki/District_9" target="_blank">District 9</a>&#8221; &#8212; Nope.  Doesn&#8217;t really make sense.  The rest of the world has been able to watch &#8220;District 9&#8243; for a couple weeks.  And again, the logo has been changed across the world.</li>
<li><strong><span style="color: #ff0000;">NEW</span></strong>: Star Trek Anniversary &#8212; Nope.  Examiner.com has a <a href="http://www.examiner.com/x-12837-US-Headlines-Examiner~y2009m9d5-Unexplained-phenomenon-Google-UFO-logo-Star-Trek-anniversary" target="_blank">story</a> that explains it might be related to Star Trek&#8217;s first airing.  Of course, that was on Sept 8th, 1966, not the 5th.  And, as one commenter pointed out, they would have used a logo of the Enterprise if that was the case.  Silly people&#8230;</li>
<li><strong><span style="color: #ff0000;">NEW</span></strong>: unexplained -<a href="http://www.unexplainedphenomenon.org/" target="_blank">scam</a>- phenomenon.org &#8212; Nope.  It sure didn&#8217;t take long for a scam to show up.  Idea!  Go_gle creates mystery on intertubes pointing to &#8220;unexplained phenomenon&#8221;&#8230;  Buy domain name unexplainedphenomenon dot org&#8230;  Put up picture of egg with light beams coming out&#8230; profit!!!  Clever, annoying, and I&#8217;m sure some &#8220;believers&#8221; will fall for it&#8230;  Sad state of affairs&#8230;</li>
<li><strong><span style="color: #ff0000;">NEW</span></strong>: Zero Wing 20 year anniversary &#8212; Nope.  <a href="http://blogs.telegraph.co.uk/technology/shanerichmond/100003402/google-ufo-logo-mystery-solved/" target="_blank">The Telegraph claims, and is wrong, that this solves the mystery</a>.  The Telegraph points to this wikipedia article.  However, if you look at the revision history, the date &#8220;September 5th, 1989&#8243; was added only yesterday.  Silly newspapers.  You think they would stop trusting everything they read on Wikipedia w/o a little research.  Wikipedia Zero Wing Articles: <a href="http://en.wikipedia.org/w/index.php?title=Zero_Wing&amp;oldid=311101372" target="_blank">Before 9/5/2009</a>; <a href="http://en.wikipedia.org/w/index.php?title=Zero_Wing&amp;oldid=312133300" target="_blank">On/After 9/5/2009</a>.</li>
</ul>
<p>Any other ridiculous, nefarious schemes floating around the interwebs?  If so, let me know.  I&#8217;m sure their flaws will be just as easy to point out.  Most likely, this is one of two things: Something related to an internal event at Go_gle or a way to build hype regarding a new product.  Of course, my speculation is just as unfounded as the other yahoos out there&#8230;</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/&amp;t=Unexplained+Phenomenom%3A+Google%27s+Doodle+Gogle" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/&amp;title=Unexplained+Phenomenom%3A+Google%27s+Doodle+Gogle&amp;summary=%0D%0A%0D%0AOkay%2C%20okay.%C2%A0%20I%20know%20you%20are%20expecting%20another%20brain-dead%20response%20to%20Go_gle%27s%20recent%20doodle.%C2%A0%20However%2C%20I%20am%20sick%20of%20it%20and%20I%20want%20to%20debunk%20several%20of%20the%20pages%20that%20say%20they%20have%20solved%20the%20mystery.%C2%A0%20Here%20are%20a%20few%20interesting%20events%3A%0D%0A%0D%0A%09Go_gle%20posted%20%221.12.12%2025.15.21.18%2015%201.18.5%202.5.12.1&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Unexplained+Phenomenom%3A+Google%27s+Doodle+Gogle+-+http://b2l.me/b4geS&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Unexplained+Phenomenom%3A+Google%27s+Doodle+Gogle&amp;du=http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/&amp;cn=%0D%0A%0D%0AOkay%2C%20okay.%C2%A0%20I%20know%20you%20are%20expecting%20another%20brain-dead%20response%20to%20Go_gle%27s%20recent%20doodle.%C2%A0%20However%2C%20I%20am%20sick%20of%20it%20and%20I%20want%20to%20debunk%20several%20of%20the%20pages%20that%20say%20they%20have%20solved%20the%20mystery.%C2%A0%20Here%20are%20a%20few%20interesting%20events%3A%0D%0A%0D%0A%09Go_gle%20posted%20%221.12.12%2025.15.21.18%2015%201.18.5%202.5.12.1" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/&amp;title=Unexplained+Phenomenom%3A+Google%27s+Doodle+Gogle" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/&amp;submitHeadline=Unexplained+Phenomenom%3A+Google%27s+Doodle+Gogle&amp;submitSummary=%0D%0A%0D%0AOkay%2C%20okay.%C2%A0%20I%20know%20you%20are%20expecting%20another%20brain-dead%20response%20to%20Go_gle%27s%20recent%20doodle.%C2%A0%20However%2C%20I%20am%20sick%20of%20it%20and%20I%20want%20to%20debunk%20several%20of%20the%20pages%20that%20say%20they%20have%20solved%20the%20mystery.%C2%A0%20Here%20are%20a%20few%20interesting%20events%3A%0D%0A%0D%0A%09Go_gle%20posted%20%221.12.12%2025.15.21.18%2015%201.18.5%202.5.12.1&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Unexplained%20Phenomenom%3A%20Google%27s%20Doodle%20Gogle%22&amp;body=Link: http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %0D%0A%0D%0AOkay%2C%20okay.%C2%A0%20I%20know%20you%20are%20expecting%20another%20brain-dead%20response%20to%20Go_gle%27s%20recent%20doodle.%C2%A0%20However%2C%20I%20am%20sick%20of%20it%20and%20I%20want%20to%20debunk%20several%20of%20the%20pages%20that%20say%20they%20have%20solved%20the%20mystery.%C2%A0%20Here%20are%20a%20few%20interesting%20events%3A%0D%0A%0D%0A%09Go_gle%20posted%20%221.12.12%2025.15.21.18%2015%201.18.5%202.5.12.1" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/unexplained-phenomenom-googles-doodle-gogle/feed/</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>Windows Server 2008 Print Services &#8211; ntprint.inf and 64-bit</title>
		<link>http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/</link>
		<comments>http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 23:48:23 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Server 2008]]></category>

		<guid isPermaLink="false">http://halfloaded.com/?p=299</guid>
		<description><![CDATA[Due to some unforeseen issues with our 2003 R2 print server, I decided it was about time to build up a new print server.  The old print server was built up by another person and it was never very stable so this was a good time to start with a clean slate. Our old server [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_301" class="wp-caption alignright" style="width: 140px"><img class="size-full wp-image-301 " title="The Good Ole' Days" src="http://halfloaded.com/wp-content/uploads/2009/08/images.jpg" alt="Server 2008" width="130" height="123" /><p class="wp-caption-text">The Good Ole&#39; Days</p></div>
<p>Due to some unforeseen issues with our 2003 R2 print server, I decided it was about time to build up a new print server.  The old print server was built up by another person and it was never very stable so this was a good time to start with a clean slate.</p>
<p>Our old server was a Dell Poweredge with a 32-bit proc.  This time, we are going to use our new VMWare ESX environment to stand up a 2008 Server in 64-bit.</p>
<p>Everything went well until I got to our Dell Printers.  I added the 64-bit drivers and setup the printer.  All was well.  I went to the sharing tab in the printer properties to add x86 (32-bit) support.  I checked the box and got an error:<span id="more-299"></span></p>
<blockquote><p>Install Components from Windows Media<br />
Please provide path to Windows media (x86 processor).<br />
Type the path where the file is located and click OK.</p></blockquote>
<p>After searching around, I came across <a href="http://social.technet.microsoft.com/Forums/en-US/winserverprint/thread/59c1d8e4-76f4-415a-9ec1-7046c9d417a2" target="_blank">this page on Technet</a>.  At the very bottom, I found the solution.  Basically, here are the steps involved:</p>
<ol>
<li>From a 32-bit OS (I used 32-bit XP Pro)</li>
<li>Browse to: \\%servername%\Printers and Faxes</li>
<li>Right click the printer you want to add 32-bit support to and select properties</li>
<li>It will tell you the 32-bit drivers are not installed and ask for the installation disk. Browse to the 32-bit drivers and hit okay.  If you say No, you will not be able to complete the steps below.</li>
<li>Once the printer&#8217;s properties are displayed, select the Sharing tab and click &#8220;Additional Drivers&#8221;</li>
<li>Check x86 and press OK</li>
<li>Browse to the 32-bit drivers and it will copy the 32-bit drivers from the local folder to \\%servername%\print%\W32X86</li>
</ol>
<p>After getting past this hurtle, I ran across it again.  Except this time, the Dell drivers were updated enough that I received a decent message:</p>
<blockquote><p>The selected driver must be installed remotely from an x86 computer using Type 3 (User mode) drivers.</p></blockquote>
<p>If you receive that message, it is basically telling you to follow the steps I outlined above.  It&#8217;s a bummer MS couldn&#8217;t have included the sub-system to support the required backward compatibility often necessary in the enterprise.  At least the workaround is simple enough.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/&amp;t=Windows+Server+2008+Print+Services+-+ntprint.inf+and+64-bit" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/&amp;title=Windows+Server+2008+Print+Services+-+ntprint.inf+and+64-bit&amp;summary=%0D%0A%0D%0ADue%20to%20some%20unforeseen%20issues%20with%20our%202003%20R2%20print%20server%2C%20I%20decided%20it%20was%20about%20time%20to%20build%20up%20a%20new%20print%20server.%C2%A0%20The%20old%20print%20server%20was%20built%20up%20by%20another%20person%20and%20it%20was%20never%20very%20stable%20so%20this%20was%20a%20good%20time%20to%20start%20with%20a%20clean%20slate.%0D%0A%0D%0AOur%20old%20server%20was%20a%20Dell%20Poweredge%20&amp;source=Andrew Healey's Blog" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Windows+Server+2008+Print+Services+-+ntprint.inf+and+64-bit+-+http://b2l.me/b4gfa&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
		<li class="shr-orkut">
			<a href="http://promote.orkut.com/preview?nt=orkut.com&amp;tt=Windows+Server+2008+Print+Services+-+ntprint.inf+and+64-bit&amp;du=http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/&amp;cn=%0D%0A%0D%0ADue%20to%20some%20unforeseen%20issues%20with%20our%202003%20R2%20print%20server%2C%20I%20decided%20it%20was%20about%20time%20to%20build%20up%20a%20new%20print%20server.%C2%A0%20The%20old%20print%20server%20was%20built%20up%20by%20another%20person%20and%20it%20was%20never%20very%20stable%20so%20this%20was%20a%20good%20time%20to%20start%20with%20a%20clean%20slate.%0D%0A%0D%0AOur%20old%20server%20was%20a%20Dell%20Poweredge%20" rel="nofollow" class="external" title="Promote this on Orkut">Promote this on Orkut</a>
		</li>
		<li class="shr-slashdot">
			<a href="http://slashdot.org/bookmark.pl?url=http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/&amp;title=Windows+Server+2008+Print+Services+-+ntprint.inf+and+64-bit" rel="nofollow" class="external" title="Submit this to SlashDot">Submit this to SlashDot</a>
		</li>
		<li class="shr-yahoobuzz">
			<a href="http://buzz.yahoo.com/submit/?submitUrl=http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/&amp;submitHeadline=Windows+Server+2008+Print+Services+-+ntprint.inf+and+64-bit&amp;submitSummary=%0D%0A%0D%0ADue%20to%20some%20unforeseen%20issues%20with%20our%202003%20R2%20print%20server%2C%20I%20decided%20it%20was%20about%20time%20to%20build%20up%20a%20new%20print%20server.%C2%A0%20The%20old%20print%20server%20was%20built%20up%20by%20another%20person%20and%20it%20was%20never%20very%20stable%20so%20this%20was%20a%20good%20time%20to%20start%20with%20a%20clean%20slate.%0D%0A%0D%0AOur%20old%20server%20was%20a%20Dell%20Poweredge%20&amp;submitCategory=science&amp;submitAssetType=text" rel="nofollow" class="external" title="Buzz up!">Buzz up!</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-comfeed">
			<a href="http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-mail">
			<a href="mailto:?subject=%22Windows%20Server%202008%20Print%20Services%20-%20ntprint.inf%20and%2064-bit%22&amp;body=Link: http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/ (sent via shareaholic)%0D%0A%0D%0A----%0D%0A %0D%0A%0D%0ADue%20to%20some%20unforeseen%20issues%20with%20our%202003%20R2%20print%20server%2C%20I%20decided%20it%20was%20about%20time%20to%20build%20up%20a%20new%20print%20server.%C2%A0%20The%20old%20print%20server%20was%20built%20up%20by%20another%20person%20and%20it%20was%20never%20very%20stable%20so%20this%20was%20a%20good%20time%20to%20start%20with%20a%20clean%20slate.%0D%0A%0D%0AOur%20old%20server%20was%20a%20Dell%20Poweredge%20" rel="nofollow" class="external" title="Email this to a friend?">Email this to a friend?</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://halfloaded.com/blog/windows-server-2008-print-services-ntprint-inf-and-64-bit/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 4.050 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-07-28 04:22:11 -->
<!-- Compression = gzip -->