<?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>The Geekery &#187; Work</title>
	<atom:link href="http://jon.netdork.net/category/work/feed" rel="self" type="application/rss+xml" />
	<link>http://jon.netdork.net</link>
	<description>The Usual Stuff...</description>
	<lastBuildDate>Sun, 18 Jul 2010 16:53:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Windows 2008, and Hibernation</title>
		<link>http://jon.netdork.net/2010/07/06/windows-2008-and-hibernation?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=windows-2008-and-hibernation</link>
		<comments>http://jon.netdork.net/2010/07/06/windows-2008-and-hibernation#comments</comments>
		<pubDate>Wed, 07 Jul 2010 01:51:18 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=903</guid>
		<description><![CDATA[Whilst driving back from our 4th of July celebrations in San Antonio, I got alerted to a server running low on disk space.&#160; As it hadn’t hit critical, and there was still a fair bit of space left, I decided to wait until I got home.&#160; When I looked at the server, I pulled up [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F07%2F06%2Fwindows-2008-and-hibernation">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F07%2F06%2Fwindows-2008-and-hibernation&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p></p><p>Whilst driving back from our 4th of July celebrations in San Antonio, I got alerted to a server running low on disk space.&#160; As it hadn’t hit critical, and there was still a fair bit of space left, I decided to wait until I got home.&#160; When I looked at the server, I pulled up my trusted space analyzer, <a href="http://www.jam-software.com/treesize_free/" target="_blank">TreeSize</a>.</p>  <span id="more-903"></span>  <p><a href="http://jon.netdork.net/wp-content/uploads/2010/07/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" class="wlDisabledImage" title="image" border="0" alt="image" align="right" src="http://jon.netdork.net/wp-content/uploads/2010/07/image_thumb.png" width="244" height="72" /></a>A quick analysis of the drive, and a report showed that there was a hefty chunk of space lost to the WinSXS directory, and 8GB of <em>Files</em> in the root of C:.&#160; This was a little odd, I know I usually use c:\temp from time to time, but never the root.&#160; To find out what was there, I first had to show hidden and system files.&#160; To do this, go to Tools, then Folder Options, then onto the View tab.&#160; There are 3 options there that we need to change.</p>  <ol>   <li>Change “Hidden files and folders” to “Show hidden files and folders”</li>    <li>Uncheck “Hide extensions for known file types”</li>    <li>Uncheck “Hide protected operating system files (Recommended)”</li> </ol>  <p>I <strong><em>highly</em></strong> recommend doing 2 all the time, you never know when somebody might sent a .txt.exe file.&#160; Changing 3 will prompt that it isn’t recommended, but do it anyway, the files I was having issues with were still hidden after changing the first two.</p>  <p>After making these changes, two files appeared that were the culprits to the lost disk space.&#160; <em>Pagefile.sys</em> and <em>Hiberfil.sys</em>.&#160; I’ll leave the explanation of the <em><a title="TechNet; What is the Page File for Anyway?" href="http://blogs.technet.com/b/askperf/archive/2007/12/14/what-is-the-page-file-for-anyway.aspx" target="_blank">Pagefile</a></em> to the experts.&#160; <em>Hiberfil.sys</em> is a file that is used to handle the state of memory, and running applications when you hibernate your computer.&#160; </p>  <h2>What is hibernation?</h2>  <p>Hibernation is a heavy sleep state for computers where all the running processes are frozen, the memory is locked, and all the states are saved into that file, then the computer is powered down.&#160; When the computer is turned back on, the operating system sees this <em>state</em> file, and starts to reload everything from there.&#160; This makes it appear like the computer was never even turned off.&#160; The applications are resumed, everything is back to the state it was before hibernation was kicked off.</p>  <h2>Why is that bad?</h2>  <p>Generally speaking, it isn’t.&#160; In fact, it’s a great thing for home computers.&#160; When you’re done reading your email at night, if you hibernate your computer, and hop into bed, your computer will be off, saving power.&#160; However this isn’t so good for servers.&#160; In 95% of cases, servers don’t ever need to hibernate.&#160; They usually have tasks, and operations that they need to run all the time, which means putting them in a state of hibernation is a bad thing as the tasks won’t be run.</p>  <h2>How do you stop this?</h2>  <p>Usually, servers have this feature turned off, but for some reason this particular one had it enabled.&#160; I’ve done some looking around, and it seems it’s may have actually been a default option to have it enabled, but for some (<em>lucky</em>) reason a handful of our other servers don’t have it on.&#160; In earlier versions of Windows, disabling the hibernation option was a case of removing a check mark from a box.&#160; This was done in the <em>Control Panel</em> under <em>Power Options</em>, and the <em>Hibernate</em> tab.&#160; However, in Windows 2008 this option was removed, and you now have to use a command line to manage this advanced option.</p>  <p></p>

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp;powercfg –hibernate off</div></div>

<p></p>  <p>Within about 10 seconds of issuing that command, the <em>Hiberfil.sys </em>file disappeared, and I recovered 4GB of disk space.&#160; You can read more about the <em>powercfg</em> command <a title="TechNet; Powercfg Command-Line options" href="http://technet.microsoft.com/en-us/library/cc748940%28WS.10%29.aspx" target="_blank">here</a>.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/07/06/windows-2008-and-hibernation/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	<!-- google ad injected by adsense-optimizer http://www.adsenseoptimizer.de -->
			<div  style="padding:7px; display: block; margin-left: auto; margin-right: auto; text-align: center;"><!-- Linkblock number: 1 --><script type="text/javascript"><!--
	 
google_ad_client = "pub-5380792458095798";
google_ad_width = 468;
google_ad_height = 15;
google_ad_format = "468x15_0ads_al"; google_ad_channel ="";
google_color_border = "CCCCCC";
google_color_bg = "F7F7F7";
google_color_link = "2970A6";
//--></script>
<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>	<item>
		<title>IIS and unknown file types</title>
		<link>http://jon.netdork.net/2010/06/17/iis-and-unknown-file-types?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=iis-and-unknown-file-types</link>
		<comments>http://jon.netdork.net/2010/06/17/iis-and-unknown-file-types#comments</comments>
		<pubDate>Thu, 17 Jun 2010 20:01:34 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=867</guid>
		<description><![CDATA[Since IIS6, or there abouts, IIS will not host a file that it does not understand, or doesn&#8217;t have a MIME handler for. This is a security feature, but can cause some unknown issues&#8230; We use some customer facing training software by Skillsoft. They produce a Java application which allows you to record voice, and [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F06%2F17%2Fiis-and-unknown-file-types">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F06%2F17%2Fiis-and-unknown-file-types&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=IIS,SysAdmin" height="61" width="50" />
			</a>
		</div><p>Since IIS6, or there abouts, <acronym title="Internet Information Services">IIS</acronym> will not host a file that it does not understand, or doesn&#8217;t have a <acronym title="Multipurpose Internet Mail Extension">MIME</acronym> handler for.  This is a security feature, but can cause some unknown issues&#8230;</p>

<p><span id="more-867"></span></p>

<p>We use some customer facing training software by Skillsoft.  They produce a Java application which allows you to record voice, and screen shows for training, and follow up with a questionnaire after.  Unfortunately because it&#8217;s Java, when something goes wrong, it&#8217;s very <em>blackbox</em>((A term coined to explain that you can see the outsides, but have no idea what&#8217;s going on inside)) like, making it hard to diagnose any issues.  In this case, the splash screen would load, and that&#8217;s where it&#8217;d stop.</p>

<p>Fortunately, the Java console does provide enough information to give us a hint as to what might be wrong.  When opening a Java application, the little console app appears in the notification area next to the clock.  This allows you to see if the app throws any errors.  In our case, it was complaining that a file with the extension .properties was missing from the server (<acronym title="Internet Information Services">IIS</acronym> was throwing a 404 message).  A quick showed it existed in the directory structure.</p>

<p>This is because <acronym title="Internet Information Services">IIS</acronym> doesn&#8217;t know what a <em>.properties</em> file is, or how it should be treated.  This is easily remedied.  In <acronym title="Internet Information Services">IIS</acronym> manager, either under the site, or at the root level, go to the <acronym title="Multipurpose Internet Mail Extension">MIME</acronym> option, and add it.  In this case, the file extension was .properties, and the <acronym title="Multipurpose Internet Mail Extension">MIME</acronym> Type was specified as <em>application/octet-stream</em>. If it&#8217;s done at the root server level, it applies to all sites.  If you do it on a site, it only applies to the site you changed it on.  No resets, or such, required.  Now the file is served properly.</p>

<p>Microsoft has this documented on <a href="http://support.microsoft.com/kb/326965" title="Microsoft; KB326965">KB326965</a>.  Whilst this applies to IIS6, the same applies to IIS7 as well.  To save some waiting in IIS7, you can use the appcmd to add the type for you&#8230;</p>

<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">appcmd <a href="http://www.ss64.com/nt/set.html"><span style="color: #b1b100; font-weight: bold;">set</span></a> config /section:staticContent /+&quot;<span style="color: #66cc66;">&#91;</span>fileExtension='.properties',mimeType='application/octet-stream'<span style="color: #66cc66;">&#93;</span>&quot;</div></div>

<p>This applies the setting at the root server level, and is usually inherited down to all sites.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/06/17/iis-and-unknown-file-types/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Saving the event of the year&#8230; Or at least the pictures</title>
		<link>http://jon.netdork.net/2010/06/08/saving-the-event-of-the-year-or-at-least-the-pictures?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=saving-the-event-of-the-year-or-at-least-the-pictures</link>
		<comments>http://jon.netdork.net/2010/06/08/saving-the-event-of-the-year-or-at-least-the-pictures#comments</comments>
		<pubDate>Wed, 09 Jun 2010 03:03:37 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[SysAdmin]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=839</guid>
		<description><![CDATA[Whilst working away this morning, I received a very pitiful look. It&#8217;s that look that we all know. The &#8220;I did something terribly wrong&#8221; kind of look. This look came with the hands of a digital camera, a small compact point and shoot. A story followed the look, as the camera was handed over to [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F06%2F08%2Fsaving-the-event-of-the-year-or-at-least-the-pictures">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F06%2F08%2Fsaving-the-event-of-the-year-or-at-least-the-pictures&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=Backup,SysAdmin" height="61" width="50" />
			</a>
		</div><p>Whilst working away this morning, I received a very pitiful look.  It&#8217;s that look that we all know.  The &#8220;I did something terribly wrong&#8221; kind of look.  This look came with the hands of a digital camera, a small compact point and shoot.  A story followed the look, as the camera was handed over to me&#8230;</p>

<p><span id="more-839"></span></p>

<blockquote>
You&#8217;ve done it before, I know you have&#8230; I don&#8217;t know what happened, if it was me, or my daughter, but all my pictures are gone.  We went to this event, and I had a lot of pictures, and now they&#8217;re all gone.  Can you save them&#8230;?
</blockquote>

<p>Fortunately for me, I know the operation for files deletes.</p>

<h2>Anatomy of a File Delete Operation</h2>

<p>What a lot of people seem to believe is when a file is deleted, the actual data is erased from the disk.  This isn&#8217;t actually true in most cases.  Really what happens behind the scene is the pointer that tells your operating system where the file is, is removed, or marked as &#8220;available&#8221;.  Essentially the index, that tells your computer where the file is, is removed.  Imagine taking whiteout to the index page in a reference book and removing information from there.  Now if you were to read every page in the reference book, you&#8217;d still find the data, but there is no &#8220;quick find&#8221; to get there.</p>

<h2>How <em>The Day</em> was saved</h2>

<p>First&#8230; Have a backup, you should have backups, but in this case, the pictures hadn&#8217;t even been taken off the camera, so chances of the person making a backup was slim, even though I knew it was likely to be slim even after it was off the camera.</p>

<p>That&#8217;s my backup rant out the way (again), now onto the fix-it.  Fortunately the camera used a storage card, so I popped it out, and put it into my card reader.  I then downloaded a copy of <a href="http://www.piriform.com/recuva" title="Piriform; Recuva">Recuva</a>.  This is freeware, but it&#8217;s not the only one, there are quite literally hundreds of different applications.  Not only is it not the only one, but most of the big name flash card manufacturers have their own software.  Once Recuva was opened, you point it to the flash card, tell it to scan, and in about 2 seconds, it&#8217;d finished reading the data on the card.  Unlike normal file access, this actually reads the bites on the card, rather than relying on the storage card to tell us about.  Once finished, you select the files you want recovered, and click the recovery button&#8230; Tada, all saved! 300+ pictures in fact, several dating back to Christmas.</p>

<h2>How it works&#8230;</h2>

<p>The <acronym title="Joint Photographics Experts Group">JPG</acronym> format is fairly easy to scan for.  There are certain markers in the file that define the start of the image, various bits of data about it (known as the EXIF data, which includes things like date taken, camera used etc), the actual image data, and an end of image marker.  When the file recovery applications scan, they look for these markers, and based on the markers they find, they should be able to identify if they can recover the image or not.  When it does the recovery steps, it reads all the bytes, from start to end, and writes to a new location.  This lets the operating system handle all the usual fun stuff like those indexes/references, and you have your file back.</p>

<h2>Caveats</h2>

<p>Now there are caveats to this whole process.  </p>

<p>First, it assumes you didn&#8217;t use a special delete program to remove the file, like <a href="http://eraser.heidi.ie/" title="Eraser">Eraser</a>, which does more than deletes the links, it goes back and writes random &#8220;stuff&#8221; over where the data actually was.  </p>

<p>Second, it assumes the system writing to the disk/memory/flash prefers completely blank space, over the space that just had data.  Most platforms prefer this because it causes less file fragmentation.</p>

<p>Lastly, this should always be considered your last resort. It&#8217;s easy for parts of the file to become overwritten because of other writes on the disk/memory/flash.  So as soon as you&#8217;ve realized you deleted it, get to work recovering it, don&#8217;t wait until next week.</p>

<p>And really, finally&#8230; Backup, backup, backup.  Did I remember to tell you to backup? No? Okay, go backup. Think it&#8217;s too hard? Go read my post on <a href="http://www.piriform.com/recuva" title="Piriform; Recuva">Home Backups</a>, and spend $50/year and get somebody else to do it.  I&#8217;m sure those memories of little Timmy&#8217;s first steps are worth it, or that winning hit at the Texas Rangers game that gets published in the news is worth it.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/06/08/saving-the-event-of-the-year-or-at-least-the-pictures/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Reverting a checkout from another workspace</title>
		<link>http://jon.netdork.net/2010/05/06/reverting-a-checkout-from-another-workspace?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=reverting-a-checkout-from-another-workspace</link>
		<comments>http://jon.netdork.net/2010/05/06/reverting-a-checkout-from-another-workspace#comments</comments>
		<pubDate>Thu, 06 May 2010 16:00:41 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=792</guid>
		<description><![CDATA[Every now and again, we have issues where a developer will have their laptop rebuilt, and forget they have files checked out in Team Foundation Server (TFS). This isn&#8217;t very helpful as sometimes they cannot undo their check outs. Visual Studio doesn&#8217;t give you access to undo a checkout in another workspace if it&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F05%2F06%2Freverting-a-checkout-from-another-workspace">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F05%2F06%2Freverting-a-checkout-from-another-workspace&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=TFS" height="61" width="50" />
			</a>
		</div><p>Every now and again, we have issues where a developer will have their laptop rebuilt, and forget they have files checked out in Team Foundation Server (TFS).  This isn&#8217;t very helpful as sometimes they cannot undo their check outs.  Visual Studio doesn&#8217;t give you access to undo a checkout in another workspace if it&#8217;s not your workspace, however the TF.exe command does.  Here&#8217;s how:</p>

<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tf /undo /workspace:workspacename;username $/project/path/to/file</div></div>

<p>This will happily undo the change on that particular file.  If you have a whole directory to revert the changes on, that&#8217;s easy too&#8230;</p>

<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tf /undo /workspace:workspacename;username /recursive $/project/path/to/directory</div></div>

<p>You must remember when reverting somebody else&#8217;s change to use the project <acronym title="Uniform Resource Locator">URL</acronym>, not the physical path on your local machine, otherwise you&#8217;ll get an error like this:</p>

<div class="codecolorer-container dos default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="dos codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">No pending changes were found <a href="http://www.ss64.com/nt/for.html"><span style="color: #00b100; font-weight: bold;">for</span></a> &lt;localpathname&gt;\file.aspx</div></div>

<p></p>

<p>For more details on the tf.exe undo command, see the Microsoft documentation <a href="http://msdn.microsoft.com/en-us/library/c72skhw4(VS.80).aspx" title="Microsoft; TF Undo command">here</a>.  Full details on arguments for the tf.exe command can be found <a href="http://msdn.microsoft.com/en-us/library/z51z7zy0(v=VS.80).aspx" title="Microsoft; TF Command">here</a> too.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/05/06/reverting-a-checkout-from-another-workspace/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell: Cleaning up IIS Logs</title>
		<link>http://jon.netdork.net/2010/04/01/powershell-cleaning-up-iis-logs?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=powershell-cleaning-up-iis-logs</link>
		<comments>http://jon.netdork.net/2010/04/01/powershell-cleaning-up-iis-logs#comments</comments>
		<pubDate>Thu, 01 Apr 2010 14:44:22 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=720</guid>
		<description><![CDATA[This one is a quick and easy one. We have multiple IIS boxes, which each generate large usage logs on a daily basis. To save space, and for analytics off-server, we compress the log files. Having found Rar is one of the better compression algorithms, we simply shell out to rar, compress the logs, and [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F04%2F01%2Fpowershell-cleaning-up-iis-logs">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F04%2F01%2Fpowershell-cleaning-up-iis-logs&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=IIS,PowerShell" height="61" width="50" />
			</a>
		</div><p>This one is a quick and easy one.  We have multiple <acronym title="Internet Information Services">IIS</acronym> boxes, which each generate large usage logs on a daily basis.  To save space, and for analytics off-server, we compress the log files.  Having found <a href="http://www.rarlabs.com" title="RarLabs">Rar</a> is one of the better compression algorithms, we simply shell out to rar, compress the logs, and cleanup older logs.</p>

<p><span id="more-720"></span></p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$winrar</span> <span style="color: pink;">=</span> <span style="color: #800000;">'d:\program files\winrar\rar.exe'</span><br />
<br />
<span style="color: #800080;">$path</span> <span style="color: pink;">=</span> <a href="about:blank"><span style="color: #000080;">$args</span></a><span style="color: #000000;">&#91;</span><span style="color: #804000;">0</span><span style="color: #000000;">&#93;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">Get-ChildItem</span> <span style="color: #800080;">$path</span> <span style="color: #008080; font-style: italic;">-recurse</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">where</span><span style="color: #000000;">&#123;</span><a href="about:blank"><span style="color: #000080;">$_</span></a>.Extension <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;log&quot;</span><span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">Foreach-Object</span> `<br />
<span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800080;">$log_name</span> <span style="color: pink;">=</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.FullName<br />
&nbsp; &nbsp; <span style="color: #800080;">$rar_name</span> <span style="color: pink;">=</span> <span style="color: #800080;">$log_name</span>.Replace<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;.log&quot;</span><span style="color: pink;">,</span> <span style="color: #800000;">&quot;.rar&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <a href="about:blank"><span style="color: #000080;">$args</span></a> <span style="color: pink;">=</span> <span style="color: #800000;">&quot;-ri1 m $rar_name $log_name&quot;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #000000;">&#91;</span>Diagnostics.Process<span style="color: #000000;">&#93;</span>::Start<span style="color: #000000;">&#40;</span><span style="color: #800080;">$winrar</span><span style="color: pink;">,</span> <a href="about:blank"><span style="color: #000080;">$args</span></a><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #008080; font-weight: bold;">Start-Sleep</span> <span style="color: pink;">-</span>s <span style="color: #804000;">5</span><br />
&nbsp; &nbsp; <br />
<span style="color: #000000;">&#125;</span><br />
<br />
<span style="color: #800080;">$date</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Date</span><br />
<span style="color: #800080;">$month</span> <span style="color: pink;">=</span> <span style="color: #800080;">$date</span>.Month<br />
<span style="color: #800080;">$year</span> <span style="color: pink;">=</span> <span style="color: #800080;">$date</span>.Year<br />
<br />
<span style="color: #800080;">$new_date</span> <span style="color: pink;">=</span> <span style="color: #008080; font-weight: bold;">Get-Date</span> <span style="color: #800000;">&quot;$month/01/$year&quot;</span><br />
<span style="color: #800080;">$log_date</span> <span style="color: pink;">=</span> <span style="color: #800080;">$new_date</span>.AddMonths<span style="color: #000000;">&#40;</span><span style="color: pink;">-</span><span style="color: #804000;">3</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #008080; font-weight: bold;">Get-ChildItem</span> <span style="color: #800080;">$path</span> <span style="color: #008080; font-style: italic;">-recurse</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.Extension <span style="color: #FF0000;">-match</span> <span style="color: #800000;">&quot;rar&quot;</span> <span style="color: #FF0000;">-and</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.LastWriteTime <span style="color: #FF0000;">-le</span> <span style="color: #800080;">$log_date</span><span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #008080; font-weight: bold;">ForEach-Object</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #008080; font-weight: bold;">Remove-Item</span> <a href="about:blank"><span style="color: #000080;">$_</span></a>.FullName<br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>

<p>This could probably do with some cleaning up as there are probably some slightly more efficient ways of doing some of this, but it works.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/04/01/powershell-cleaning-up-iis-logs/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PowerShell: Remote Registry, and fixing an Office 2007 install</title>
		<link>http://jon.netdork.net/2010/03/29/powershell-remote-registry-and-fixing-an-office-2007-install?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=powershell-remote-registry-and-fixing-an-office-2007-install</link>
		<comments>http://jon.netdork.net/2010/03/29/powershell-remote-registry-and-fixing-an-office-2007-install#comments</comments>
		<pubDate>Mon, 29 Mar 2010 16:10:33 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[KB928218]]></category>
		<category><![CDATA[Remote Registry]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=688</guid>
		<description><![CDATA[We&#8217;ve had a stubborn Windows 2003 server that we&#8217;ve been trying to get Office 2007 installed for a while. It has a couple of things wrong with it which have made the install substantially harder. The first being an MSI speed issue. Because the server plays host to about 120+ custom applications, all installed using [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F29%2Fpowershell-remote-registry-and-fixing-an-office-2007-install">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F29%2Fpowershell-remote-registry-and-fixing-an-office-2007-install&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=KB928218,Microsoft,PowerShell,Remote+Registry" height="61" width="50" />
			</a>
		</div><p>We&#8217;ve had a stubborn Windows 2003 server that we&#8217;ve been trying to get Office 2007 installed for a while.  It has a couple of things wrong with it which have made the install substantially harder.  </p>

<p><span id="more-688"></span></p>

<p>The first being an MSI speed issue.  Because the server plays host to about 120+ custom applications, all installed using MSI, any further MSI installs simply drag whilst it reads through all the keys, does its validation and backup checks, and then proceeds.</p>

<p>The second issue we have is that this box has a partially installed, corrupted Office 2007 install already on here.  Attempting to do &#8220;upgrades&#8221; fail, and uninstalling just barfs with a delightful error.  This resulted in some stumbling to figure out how to get it off, and start again.</p>

<p>Fortunately Microsoft do frequently document things like this, you just have to find the right search terms to find it, which luckily I did, in the form of <a href="http://support.microsoft.com/kb/928218/" title="Microsoft Support; KB928218; How to manually uninstall the 2007 Office system if you cannot uninstall it by using the 'Add or Remove Programs' feature">KB928218</a>.  This article gives you a list of the registry keys you have to go through and remove, and you should be all well and good.  Unfortunately, this list is over 200 registry keys on our count, and quite a list all over the place.  This is where Powershell comes in handy&#8230;</p>

<p>As the server itself doesn&#8217;t (yet) have Powershell installed, I ran the commands from my laptop, which required remote registry access.  Powershell makes use of the .Net libraries to do this:</p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$server</span> <span style="color: pink;">=</span> <span style="color: #800000;">'MyRemoteServer'</span><br />
<span style="color: #800080;">$reg</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryKey<span style="color: #000000;">&#93;</span>::OpenRemoteBaseKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'LocalMachine'</span><span style="color: pink;">,</span> <span style="color: #800080;">$server</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>

<p>The <em>LocalMachine</em> reference here is the part of the registry we want to open, which is equivalent to HKEY_LOCAL_MACHINE.  This now gives us a registry object in the HKLM section of the registry.  From here, there are a bunch of functions we can use to fetch the keys we need.  The first is <em>OpenSubKey</em>.  This opens a subkey in the <em>$reg</em> object.</p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>4<br />5<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800000;">&quot;Removing Office 12 Software Keys&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Office'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>

<p>This assigns <em>$regKey</em> to the subkey.  The boolean flag <em>$true</em> on the end is to make sure the key is opened in writable mode.  This will be required to modify the contents of the key.</p>

<p>Per the <acronym title="Kilobyte">KB</acronym> article, Microsoft say to delete all of the 12.0 subkey from under here.  I had originally used the following:</p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>6<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$regKey</span>.DeleteSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'12.0'</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>

<p>This resulted in an error about not being allowed to delete subkeys.  Then I stumbled upon the much more suitable <em>DeleteSubKeyTree</em>, which, as the name hints, deletes the tree.  So the new code became:</p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>6<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$regKey</span>.DeleteSubKeyTree<span style="color: #000000;">&#40;</span><span style="color: #800000;">'12.0'</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>

<p>This was repeated for the various other subkeys Microsoft recommended deleting.  It became more complex when it asks you to delete keys that match some of the characters below, and use a * as the match.  For example:</p>

<blockquote>
Note In the following registry keys, the asterisk character (*) represents one or more characters in the subkey name.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\*0FF1CE*
</blockquote>

<p>Fortunately, Powershell is very good at string manipulation, and queries, so this was a bit of a case for a where, and foreach loop.</p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>23<br />24<br />25<br />26<br />27<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*0FF1CE*&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #800080;">$regKey</span>.DeleteSubKeyTree<span style="color: #000000;">&#40;</span><a href="about:blank"><span style="color: #000080;">$_</span></a><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#125;</span></div></td></tr></tbody></table></div>

<p>It looks pretty messy, but it&#8217;s actually pretty easy if you understand pipes (the | character).  The above line 24 boils down to:</p>

<ul>
<li>Get the subkey names</li>
<li>Find only the ones that have 0FF1CE in them (yes I know that&#8217;s office with a zero and a one)</li>
<li>For each one that matches, go delete it, and its children</li>
</ul>

<p>See, not so hard.</p>

<p>There are some parts of this that venture <acronym title="Kilobyte">KB</acronym> into other areas of the registry, so the syntax changes in the opening command, for example:</p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>67<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$reg</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryKey<span style="color: #000000;">&#93;</span>::OpenRemoteBaseKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'ClassesRoot'</span><span style="color: pink;">,</span> <span style="color: #800080;">$server</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div>

<p>This opens HKEY_CLASSES_ROOT.  You can use CurrentUser to access HKEY_CURRENT_USER too.</p>

<p>That&#8217;s about it for remote registry access and fixing this blasted Office install.  As a side, the script saved me about 30 minutes of bashing through about 200+ registry keys for cleaning up.</p>

<p>Below is the full script, with the delete statements commented out.  If you have 2007 installed, give it a run, see what happens (<strong>please</strong> double check that all the deletes are in fact commented out, this script was used against a server to fix an install issue, and did have active delete statements in, and I cannot remember if I got all the deletes).</p>

<div class="codecolorer-container powershell default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br /></div></td><td><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$server</span> <span style="color: pink;">=</span> <span style="color: #800000;">'MyRemoteServer'</span><br />
<span style="color: #800080;">$reg</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryKey<span style="color: #000000;">&#93;</span>::OpenRemoteBaseKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;LocalMachine&quot;</span><span style="color: pink;">,</span> <span style="color: #800080;">$server</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing Office 12 Software Keys&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Office\'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008000;">#$regKey.DeleteSubKeyTree('12.0')</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing 2003 shadow keys&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'Software\Microsoft\Windows NT\CurrentVersion\Terminal Server\Install\Software\Microsoft\Office'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008000;">#$regKey.DeleteSubKeyTree('12.0')</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing office download references&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Office\Delivery\SourceEngine\Downloads'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span><span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*0FF1CE*&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_);</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing Office Uninstall keys&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*0FF1CE*&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_)</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing Office upgrade keys&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UpgradeCodes'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*F01FEC&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_)</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing Office product key references&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*F01FEC&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_)</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing Office services&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SYSTEM\CurrentControlSet\Services'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008000;">#$regKey.DeleteSubKeyTree('ose')</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800000;">&quot;Removing Uninstall keys&quot;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span><span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800080;">$subName</span> <span style="color: pink;">=</span> <a href="about:blank"><span style="color: #000080;">$_</span></a><br />
&nbsp; <span style="color: #800080;">$subKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$regKey</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800080;">$subName</span><span style="color: #000000;">&#41;</span><br />
&nbsp; <span style="color: #800080;">$value</span> <span style="color: pink;">=</span> <span style="color: #800080;">$subKey</span>.GetValue<span style="color: #000000;">&#40;</span><span style="color: #800000;">&quot;UninstallString&quot;</span><span style="color: #000000;">&#41;</span><br />
&nbsp; <span style="color: #0000FF;">if</span> <span style="color: #000000;">&#40;</span><span style="color: #800080;">$value</span> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*Office Setup Controller\Setup.*&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #800000;">&quot;Deleting Uninstall key $subName&quot;</span><br />
&nbsp; &nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($subName)</span><br />
&nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; <span style="color: #800080;">$subKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$reg</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$reg</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryKey<span style="color: #000000;">&#93;</span>::OpenRemoteBaseKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'ClassesRoot'</span><span style="color: pink;">,</span> <span style="color: #800080;">$server</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'Installer\Features'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*F01FEC&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_)</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'Installer\Products'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*F01FEC&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_)</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'Installer\UpgradeCodes'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*F01FEC&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_)</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'Installer\Win32Assemblies'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span>.GetSubKeyNames<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">Where</span> <span style="color: #000000;">&#123;</span> <a href="about:blank"><span style="color: #000080;">$_</span></a> <span style="color: #FF0000;">-like</span> <span style="color: #800000;">&quot;*Office12*&quot;</span> <span style="color: #000000;">&#125;</span> <span style="color: pink;">|</span> <span style="color: #0000FF;">ForEach</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; <span style="color: #800000;">&quot;Deleting subkey $_&quot;</span><br />
&nbsp; <span style="color: #008000;">#$regKey.DeleteSubKeyTree($_)</span><br />
<span style="color: #000000;">&#125;</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$reg</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<br />
<span style="color: #800000;">&quot;Deleting UserInfo&quot;</span><br />
<span style="color: #800080;">$reg</span> <span style="color: pink;">=</span> <span style="color: #000000;">&#91;</span>Microsoft.Win32.RegistryKey<span style="color: #000000;">&#93;</span>::OpenRemoteBaseKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'CurrentUser'</span><span style="color: pink;">,</span> <span style="color: #800080;">$server</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #800080;">$regKey</span> <span style="color: pink;">=</span> <span style="color: #800080;">$reg</span>.OpenSubKey<span style="color: #000000;">&#40;</span><span style="color: #800000;">'Software\Microsoft\Office\Common'</span><span style="color: pink;">,</span> <span style="color: #800080;">$true</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #008000;">#$regKey.DeleteSubKeyTree('UserInfo')</span><br />
<span style="color: #800080;">$regKey</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #800080;">$reg</span>.Close<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></div></td></tr></tbody></table></div><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/03/29/powershell-remote-registry-and-fixing-an-office-2007-install/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	<!-- google ad injected by adsense-optimizer http://www.adsenseoptimizer.de -->
			<div  style="padding:7px; display: block; margin-left: auto; margin-right: auto; text-align: center;"><!-- Ad number: 1 --><script type="text/javascript"><!--
    	 
    	google_ad_client = "pub-5380792458095798"; google_alternate_color = "FFFFFF";
		google_ad_width = 468; google_ad_height = 60;
		google_ad_format = "468x60_as"; google_ad_type = "text";
		google_ad_channel =""; google_color_border = "CCCCCC";
		google_color_link = "2970A6"; google_color_bg = "F7F7F7";
		google_color_text = "555555"; google_color_url = "2970A6";
		google_ui_features = "rc:10"; //--></script>
		<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script></div>	<item>
		<title>Support Contacts&#8230;</title>
		<link>http://jon.netdork.net/2010/03/17/support-contacts?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=support-contacts</link>
		<comments>http://jon.netdork.net/2010/03/17/support-contacts#comments</comments>
		<pubDate>Wed, 17 Mar 2010 13:18:20 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[General Ramblings]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[SLA]]></category>
		<category><![CDATA[Support]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=671</guid>
		<description><![CDATA[The Networker Blog has an excellent post on support contracts, coining the term Icarus Support Contract. Preston warns on the dangers of using a using minimal support agreements when covering equipment, and software in an environment that is covered by an SLA. Preston defined an Icarus support contract as&#8230; Well, it’s a contract where you [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F17%2Fsupport-contacts">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F17%2Fsupport-contacts&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=SLA,Support" height="61" width="50" />
			</a>
		</div><p><a href="http://nsrd.info/blog/" title="The Networker Blog">The Networker Blog</a> has an excellent <a href="http://nsrd.info/blog/2010/03/17/the-perils-of-an-icarus-support-contract/" title="The Networker Blog; The perils of an Icarus support contract">post</a> on support contracts, coining the term <em>Icarus Support Contract</em>.  Preston warns on the dangers of using a using minimal support agreements when covering equipment, and software in an environment that is covered by an <acronym title="Service Level Agreement">SLA</acronym>.</p>

<p><span id="more-671"></span></p>

<p>Preston defined an <em>Icarus support contract</em> as&#8230;</p>

<blockquote>
Well, it’s a contract where you rely on luck. It’s a gamble – that in the event of a serious problem, you can buy immediate assistance at the drop of a hat.
</blockquote>

<p>I think this is a great post, and an excellent example of why people probably need to step back, and address their support needs, and agreements.  I can even cite a personal example from recently.  During out data center migrations, as part of the company transition to a new parent company, the support agreement slipped on several devices.  They were expired by, quite literally, a month.  During that time, 2 of the devices had physical hardware failures, and required an RMA to resolve.  Unfortunately because they were out of contract, it would have cost us a fortune.  Fortunately enough, the vendor was good enough to work with us, and get it sorted, they were even good enough to drop the <em>re-up</em> fees required on the other devices.  Had we had the support contracts in place, we&#8217;d have had a device on site the next day, instead we ended up waiting nearly 2 weeks due to dealing with contracts, approvals, and signatures.  Fortunately the devices were not scheduled to be deployed for another 3 months&#8230; But what were to have happened if they were live systems?  I think our customers would have been rather upset about the 2 week outage.</p>

<p>So do you have enough of a support agreement to cover your equipment, both software and hardware, to cover your SLAs? If not, ask yourself how much it&#8217;ll cost you to get there, and if it&#8217;s worth the initial expenditure, or the cost of customer loss.  If you don&#8217;t have an <acronym title="Service Level Agreement">SLA</acronym>, do your customers have an expectation of you, and your services? If so, now is the time to establish a well documented, and agreed upon, <acronym title="Service Level Agreement">SLA</acronym>, and make sure your support agreements are up to scratch to help cover the SLAs.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/03/17/support-contacts/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An error occurred while validating. HRESULT=80004005</title>
		<link>http://jon.netdork.net/2010/03/12/an-error-occurred-while-validating-hresult80004005?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=an-error-occurred-while-validating-hresult80004005</link>
		<comments>http://jon.netdork.net/2010/03/12/an-error-occurred-while-validating-hresult80004005#comments</comments>
		<pubDate>Fri, 12 Mar 2010 18:26:47 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=649</guid>
		<description><![CDATA[For the last day or so, we&#8217;ve been working on rolling out the next release of our code to our QA environment. When it came time to build a new set of solutions I stumbled across a weird validation error. An error occurred while validating. &#160;HRESULT=80004005 This error popped up on the setup applications for [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F12%2Fan-error-occurred-while-validating-hresult80004005">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F12%2Fan-error-occurred-while-validating-hresult80004005&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=Work" height="61" width="50" />
			</a>
		</div><p>For the last day or so, we&#8217;ve been working on rolling out the next release of our code to our QA environment.  When it came time to build a new set of solutions I stumbled across a weird validation error.</p>

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">An error occurred while validating. &nbsp;HRESULT=80004005</div></div>

<p><a href="http://jon.netdork.net/wp-content/uploads/2010/03/broken_comment.png"><img src="http://jon.netdork.net/wp-content/uploads/2010/03/broken_comment-150x150.png" alt="" title="broken_comment" width="150" height="150" class="alignright size-thumbnail wp-image-651" /></a> This error popped up on the setup applications for several new programs. Doing some searching I stumbled across a couple of posts that hinted on removing the project output from the setup, and trying again.  This stopped the errors on the setup application, but not the actual application itself.</p>

<p>Then I saw a hint in the errors list&#8230;</p>

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Application Configuration file &quot;App.config&quot; is invalid. '-' is an unexpected token.</div></div>

<p>Checking into the app.config file, I stumbled across the cause.  It looks like somebody had pasted code that had been &#8220;fixed&#8221; up by Outlook, or word, and broken a comment.  Fixing this, resolved both the app compilation, and the setup validation error.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/03/12/an-error-occurred-while-validating-hresult80004005/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IIS7 &amp; AppCmd handyness&#8230;</title>
		<link>http://jon.netdork.net/2010/03/01/iis7-appcmd-handyness?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=iis7-appcmd-handyness</link>
		<comments>http://jon.netdork.net/2010/03/01/iis7-appcmd-handyness#comments</comments>
		<pubDate>Mon, 01 Mar 2010 16:34:32 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[AppCmd]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=632</guid>
		<description><![CDATA[Part of our move was including the building of the new DR environment. Like most people, we cheated, and cloned the production servers to the new environment. One issue was host naming changes. In our DR environment, the host names change due to the location, and roll of the servers. This means that various IIS [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F01%2Fiis7-appcmd-handyness">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F03%2F01%2Fiis7-appcmd-handyness&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly&amp;hashtags=AppCmd,IIS,Microsoft" height="61" width="50" />
			</a>
		</div><p>Part of our move was including the building of the new <abbr title="Disaster Recover">DR</abbr> environment.  Like most people, we cheated, and cloned the production servers to the new environment.  One issue was host naming changes.  In our DR environment, the host names change due to the location, and roll of the servers.  This means that various <acronym title="Internet Information Services">IIS</acronym> config options are now incorrect.  This is easily fixed with the new AppCmd in IIS7.</p>

<div class="codecolorer-container winbatch default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="winbatch codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">appcmd set vdir <span style="color: #66cc66;">/</span>vdir.name<span style="color: #FF1010; font-weight: bold;">:&quot;SiteName/virtual_dir&quot; /physicalPath:&quot;\\NewServer\Images&quot;</span></div></div>

<p>The command is relatively easy to understand.  <code>/vdir.name</code> is the path to the site, and virtual directory, and <code>/physicalPath</code> is the new path.  Easy huh?</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/03/01/iis7-appcmd-handyness/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reactive vs Proactive&#8230;</title>
		<link>http://jon.netdork.net/2010/01/25/reactive-vs-proactive?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=reactive-vs-proactive</link>
		<comments>http://jon.netdork.net/2010/01/25/reactive-vs-proactive#comments</comments>
		<pubDate>Tue, 26 Jan 2010 04:41:17 +0000</pubDate>
		<dc:creator>Jonathan Angliss</dc:creator>
				<category><![CDATA[Sys Admin]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://jon.netdork.net/?p=615</guid>
		<description><![CDATA[I&#8217;m obviously playing catch up with a number of posts I&#8217;ve been meaning to do. This was something from something I read back in November by Tom Limoncelli, but was something I had planned on writing about anyway. The post, titled &#8220;Run, run, run, dead&#8220;, brings a nice analogy of things breaking in the analog/digital [...]]]></description>
			<content:encoded><![CDATA[<!-- google_ad_section_start --><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F01%2F25%2Freactive-vs-proactive">
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fjon.netdork.net%2F2010%2F01%2F25%2Freactive-vs-proactive&amp;source=j_angliss&amp;style=normal&amp;service=bit.ly" height="61" width="50" />
			</a>
		</div><p>I&#8217;m obviously playing catch up with a number of posts I&#8217;ve been meaning to do.  This was something from something I read back in November by Tom Limoncelli, but was something I had planned on writing about anyway. The post, titled &#8220;<a href="http://everythingsysadmin.com/2009/11/run-run-run-dead.html" title="Everything Sysadmin; Run, Run, Run, Dead">Run, run, run, dead</a>&#8220;, brings a nice analogy of things breaking in the analog/digital eras, and points out that as system administrators, we should be using the <em>analog</em> method of monitoring.</p>

<p><span id="more-615"></span></p>

<blockquote>
An analog radio (one with an old-fashion vacuum tube) sounds great at first, but you hear more static when the tube starts to wear out. Then the tube dies and you hear nothing. If you change the tube when it starts to degrade, you&#8217;ll never have a dead radio. (Assume, of course, you change the tube when your favorite radio show isn&#8217;t on.)

A transistor radio, on the other hand, is digital. It plays and plays and plays and then stops. Now, during your favorite song, you have to repair it.
</blockquote>

<p><a href="http://jon.netdork.net/wp-content/uploads/2010/01/vpn_conn.png"><img src="http://jon.netdork.net/wp-content/uploads/2010/01/vpn_conn-150x150.png" alt="" title="vpn_conn" width="150" height="150" class="alignright size-thumbnail wp-image-616" /></a>This is one of those great analogies that works well for the situation.  Watching for the host to go down is reactive, it&#8217;s already too late (transistor radio), watching for stuff changing, and adapting your system(s) to it is proactive.  Take for example the image to the right.  This is Nagios monitoring our VPN server&#8217;s connection counts.  The server was in a small subnet, with a restricted number of connections (30).  Nagios warns to excessive connections at 25, and alerts critical at 27.  This allows us to take a look, and bump duplicate connections, or excessive timed connections.  This was a temporary solution, because like any good admin, we didn&#8217;t want to sit messing with peoples&#8217; connections all the time, so we <a href="http://jon.netdork.net/2010/01/13/moving-your-ras-server" title="The Geekery; Moving your RAS server">moved the server</a> so we could give it a bigger block.  In this scenario we reacted to the changing demand of the VPN server as we watched trends (the year graph shows a trend upwards from 10-15 up to the current 25-28).</p>

<p>This is just one example of a reactive monitor, we watch all kinds of metrics from memory, to disk space, to IO, to webserver connections, all the way through to bandwidth utilization on our connections and VPN tunnels.</p>

<p>Reactive is fine for up/down status, but no good way to plan for your future needs, or your current performance trends.  If you&#8217;ve not read either of Tom&#8217;s books, and you&#8217;d a system administrator, you should.</p><!-- google_ad_section_end -->]]></content:encoded>
			<wfw:commentRss>http://jon.netdork.net/2010/01/25/reactive-vs-proactive/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
