<?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>Jeff Wouters&#039;s Blog</title>
	<atom:link href="http://jeffwouters.nl/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://jeffwouters.nl</link>
	<description>A geeky mind is a joy forever...</description>
	<lastBuildDate>Mon, 06 Feb 2012 18:04:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PowerShell one-liner for inventory of memory configurations and availability&#8211;Part one</title>
		<link>http://jeffwouters.nl/index.php/2012/02/powershell-one-liner-for-inventory-of-memory-configurations-and-availabilitypart-one/</link>
		<comments>http://jeffwouters.nl/index.php/2012/02/powershell-one-liner-for-inventory-of-memory-configurations-and-availabilitypart-one/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 18:04:45 +0000</pubDate>
		<dc:creator>Jeff Wouters</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SCVMM]]></category>

		<guid isPermaLink="false">http://jeffwouters.nl/?p=649</guid>
		<description><![CDATA[A customer of mine is planning to consolidate several Hyper-V clusters into one or two big ones. In order to do that, I had to report on the amounts of memory currently offered by the Hyper-V hosts and the memory configurations of the virtual machines. When I would use MAP, yet another tool would be [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:right;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F02%2Fpowershell-one-liner-for-inventory-of-memory-configurations-and-availabilitypart-one%2F' data-shr_title='PowerShell+one-liner+for+inventory+of+memory+configurations+and+availability%26ndash%3BPart+one'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F02%2Fpowershell-one-liner-for-inventory-of-memory-configurations-and-availabilitypart-one%2F' data-shr_title='PowerShell+one-liner+for+inventory+of+memory+configurations+and+availability%26ndash%3BPart+one'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><font size="3" face="Arial">A customer of mine is planning to consolidate several Hyper-V clusters into one or two big ones.     <br />In order to do that, I had to report on the amounts of memory currently offered by the Hyper-V hosts and the memory configurations of the virtual machines.</font></p>
<p><font size="3" face="Arial">When I would use MAP, yet another tool would be introduced into the environment… and only to report on the memory configuration? It seemed to me that this would be a bit overkill.     <br />But then there is SCOM. This customer already has SCOM implemented and configured… but since I’m a n00b when it comes to SCOM this would not have been my favorite solution for such a simple task.</font></p>
<p><font size="3" face="Arial">So I turned yet again to my buddy PowerShell <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Glimlach" src="http://jeffwouters.nl/wp-content/uploads/2012/02/wlEmoticon-smile.png" /></font></p>
<p><font size="3" face="Arial">I created a small one-liner to provide an output of all the VM’s, their respective nodes, the amount of memory offered by the nodes and the memory configuration of the VM’s.     <br /><em>       <br />Note: This one-liner looks at static memory configurations, not dynamic memory configurations and is based on the SCVMM PowerShell cmdlets</em>!</font></p>
<blockquote><p><font size="3" face="Arial">Get-VM -vmmserver SCVMM01 | select name,memory,vmhost,@{n=&#8217;TotalMemoryOfHost(GB)&#8217;;e={&quot;{0:N0}&quot; -f ((Get-VMHost &amp;_.VMHost).TotalMemory/1MB)}} | sort VMHost | convertto-html &gt; D:\Temp\MemoryConfig.html</font></p>
</blockquote>
<p><font size="3" face="Arial">This will give you an output looking like this:</font></p>
<p> <a href="http://jeffwouters.nl/wp-content/uploads/2012/02/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jeffwouters.nl/wp-content/uploads/2012/02/image_thumb.png" width="437" height="327" /></a></p>
<div class="shr-publisher-649"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=PowerShell+one-liner+for+inventory+of+memory+configurations+and+availability%E2%80%93Part+one+http%3A%2F%2Fjeffwouters.nl%2F%3Fp%3D649" title="Post to Twitter"><img class="nothumb" src="http://jeffwouters.nl/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://jeffwouters.nl/index.php/2012/02/powershell-one-liner-for-inventory-of-memory-configurations-and-availabilitypart-one/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCVMM &#8211; Error (402) Library server is not associated with this Virtual Machine Server</title>
		<link>http://jeffwouters.nl/index.php/2012/01/scvmm-error-402-library-server-is-not-associated-with-this-virtual-machine-server/</link>
		<comments>http://jeffwouters.nl/index.php/2012/01/scvmm-error-402-library-server-is-not-associated-with-this-virtual-machine-server/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 10:40:04 +0000</pubDate>
		<dc:creator>Jeff Wouters</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[SCVMM]]></category>

		<guid isPermaLink="false">http://jeffwouters.nl/?p=644</guid>
		<description><![CDATA[Sometimes, the status of a VM in SCVMM gets stuck although that status is faulty. In my case, it got stuck to “failed” and when viewing the job in SCVMM, I saw a nice little error: Error (402) Library server is not associated with this Virtual Machine Server. Refreshing the status of the virtual machine, [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:right;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fscvmm-error-402-library-server-is-not-associated-with-this-virtual-machine-server%2F' data-shr_title='SCVMM+%26ndash%3B+Error+%28402%29+Library+server+is+not+associated+with+this+Virtual+Machine+Server'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fscvmm-error-402-library-server-is-not-associated-with-this-virtual-machine-server%2F' data-shr_title='SCVMM+%26ndash%3B+Error+%28402%29+Library+server+is+not+associated+with+this+Virtual+Machine+Server'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><font size="3" face="Arial">Sometimes, the status of a VM in SCVMM gets stuck although that status is faulty.     <br />In my case, it got stuck to “failed” and when viewing the job in SCVMM, I saw a nice little error:      <br /><em>Error (402)       <br />Library server is not associated with this Virtual Machine Server.</em>      </p>
<p><a href="http://jeffwouters.nl/wp-content/uploads/2012/01/image6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://jeffwouters.nl/wp-content/uploads/2012/01/image_thumb6.png" width="599" height="170" /></a>      </p>
<p>Refreshing the status of the virtual machine, rebooting the SCVMM Server… nothing seemed to change the status to the correct value.      </p>
<p>So, I started doing something most people are afraid to do… I dove in the SCVMM database.      <br />By doing some research at TechNet and a bunch of for a I found that by removing all the entries from the table named “<em>dbo.tbl_WLC_VObject</em>” will force the SCVMM server to contact the Hyper-V hosts to update its database.      </p>
<p>Now, removing all the entries will have a serious impact… and that’s not what I wanted since it was a production environment.      </p>
<p>When you go to the SQL Management Studio, expand the SCVMM database, expand the tables and select “<em>Edit top 200 Rows</em>” by right-clicking on the “<em>dbo.tbl_WLC_VObject</em>”.      <br />Find all the entries with your VM name it in and delete them.      <br />* If you have more than 200 entries in there, change the default number of rows to show by following <a href="http://www.mssqltips.com/sqlservertip/2323/change-default-value-for-select-top-n-and-edit-top-n-rows-in-sql-server-studio/">this article</a> and start over.      <br />Now, reboot the SCVMM server and check if the list of virtual machines is repopulated (may take a little time) and most importantly… check if the status of your virtual machine is changed to the correct value <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile4.png" />      </p>
<p><em><strong>Big fat note:</strong> Making manual changes in the SCVMM database is not supported. When you decide to do it anyway, please make sure you have a recent backup before you start making changes!!!</em></font></p>
<div class="shr-publisher-644"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=SCVMM+%E2%80%93+Error+%28402%29+Library+server+is+not+associated+with+this+Virtual+Machine+Server+http%3A%2F%2Fjeffwouters.nl%2F%3Fp%3D644" title="Post to Twitter"><img class="nothumb" src="http://jeffwouters.nl/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://jeffwouters.nl/index.php/2012/01/scvmm-error-402-library-server-is-not-associated-with-this-virtual-machine-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Data Deduplication in Windows 8 explained from A to Z</title>
		<link>http://jeffwouters.nl/index.php/2012/01/disk-deduplication-in-windows-8-explained-from-a-to-z/</link>
		<comments>http://jeffwouters.nl/index.php/2012/01/disk-deduplication-in-windows-8-explained-from-a-to-z/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 09:44:22 +0000</pubDate>
		<dc:creator>Jeff Wouters</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://jeffwouters.nl/?p=637</guid>
		<description><![CDATA[Last week I was at the Hyper-V.nu event at Microsoft Netherlands HQ in Amsterdam. Ronald Beekelaar (MVP Virtual Machine aka MVP Hyper-V) gave a Data Deduplication Deep Dive session. This was a very good and highly technical session, which got me thinking… and I decided to write a little article about this new technology in [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:right;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fdisk-deduplication-in-windows-8-explained-from-a-to-z%2F' data-shr_title='Data+Deduplication+in+Windows+8+explained+from+A+to+Z'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fdisk-deduplication-in-windows-8-explained-from-a-to-z%2F' data-shr_title='Data+Deduplication+in+Windows+8+explained+from+A+to+Z'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><span style="font-family: Arial; font-size: small;">Last week I was at the <a href="http://hyper-v.nu/">Hyper-V.nu</a> event at Microsoft Netherlands HQ in Amsterdam.<br />
<a href="https://mvp.support.microsoft.com/profile=FBF14969-9244-4CD2-AFDD-BBBE443D1CC9">Ronald Beekelaar</a> (MVP Virtual Machine aka MVP Hyper-V) gave a Data Deduplication Deep Dive session.<br />
This was a very good and highly technical session, which got me thinking… and I decided to write a little article about this new technology in Windows 8. </span></p>
<p><span style="font-family: Arial; font-size: small;"><em><strong>Introducing: Deduplication in Windows 8</strong></em><br />
With Windows Server 8 Microsoft introduces a built-in software based data deduplication (dedupe) solution. Where several storage providers offer such solutions, Microsoft has taken another approach by providing a solution for duplicate data from an operating system level instead of a storage level. Where some deduplication solutions provide their services file-based, the deduplication offered in Windows Server 8 does this block-based. More on that later on… </span></p>
<p>Now, let’s take a few pointers before we start looking at dedupe in Windows Server 8:</p>
<ul>
<li>Only available in Windows <span style="text-decoration: underline;">Server</span> 8.</li>
<li>Is cluster aware.</li>
<li>Based on a filter driver per volume.</li>
<li>Not supported on boot- or system volumes, only intended for data storage volumes.</li>
<li>Does not work on compressed or NTFS encrypted files.</li>
<li>Dedupe requires an NTFS file system and is not supported for the new ReFS file system which is introduced in Windows 8.</li>
<li>Does not work with Cluster Shared Volumes.</li>
<li>Does not work with encrypted files, files smaller than 64KB, re-parse points or files with extended attributes.</li>
<li>Not configurable through Group Policy.</li>
<li>It is a post-process deduplication process.</li>
<li>Windows caching is dedupe aware.</li>
</ul>
<p><strong><em><br />
</em></strong></p>
<p><strong><em>How does it work?</em><br />
</strong>For me this is always the most fun question to ask… because when you know how it works, you can understand the use case and the possible gotcha’s when designing an environment that makes use of this technology.<br />
Dedupe looks at the storage from a block-based point of view and divides the storage on ‘chunks’ which are typically somewhere between 32 and 128 KB in size with an average of 80K, although smaller chunks are possible.<br />
To understand dedupe in Windows Server 8, we first have to understand the concept of ‘hard links’.</p>
<p>When data is stored on a file system, the actual bits and bytes are stored on a single location. So, if some bits are the same… why save it multiple times? By using hard links you can refer to bits which can be used by multiple files.<br />
Let’s clarify that one a little… When you have hundreds of *.docs files created by your HR department, they probably use some templates. This means that a lot bits and bytes in the files is exactly the same!<br />
Since dedupe views the storage in chunks, it will notice a lot of those being exactly the same. So, instead of saving the bits and bytes multiple times, it saves the chunk only one time and creates hard links on all locations so they refer to the same data.</p>
<p>When you view the properties of the Program Files folder, you will probably notice that the values behind “Size” and “Size on disk” differ from each other.<br />
<a href="http://jeffwouters.nl/wp-content/uploads/2012/01/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://jeffwouters.nl/wp-content/uploads/2012/01/image_thumb.png" alt="image" width="240" height="96" border="0" /></a></p>
<p>This is because some hard links are used for files in this folder. So “Size on disk” involves the accumulated amount of bits and bytes by the files in this folder and “Size” equals the accumulates amount of bits and bites on the disk minus the bits and bites that are replaced by hard links.<br />
Note that the example provided above is file based, where dedupe is block based and provides a far better utilization of the available storage.</p>
<p>I found the diagram below which clearly explains the basic concept of dedupe.<br />
<a href="http://jeffwouters.nl/wp-content/uploads/2012/01/image1.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://jeffwouters.nl/wp-content/uploads/2012/01/image_thumb1.png" alt="image" width="452" height="342" border="0" /></a><br />
As you can see, some chunks (A, B and C) are used by both files.<br />
By using a technology similar to hard links, but on block-level, all files can access the correct bits and bytes where they only need to be stored once instead of multiple times.</p>
<p>The dedupe process works through scheduled tasks, but can be run interactively by using PowerShell. More about that command later on…</p>
<p><strong><em>Why use data deduplication?<br />
</em></strong>A valid question… what benefits does dedupe provide? A lot of my customers require massive amounts of storage.<br />
The purpose of dedupe is the better utilize the storage capacity which is available to you.<br />
Microsoft has done some research in their dedupe technology and come up with some numbers on the storage savings dedupe provided:</p>
<table width="400" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="200">General</td>
<td valign="top" width="200">50-60% savings</td>
</tr>
<tr>
<td valign="top" width="200">Documents</td>
<td valign="top" width="200">30-50% savings</td>
</tr>
<tr>
<td valign="top" width="200">Application Library</td>
<td valign="top" width="200">70-80% savings</td>
</tr>
<tr>
<td valign="top" width="200">VHD Library</td>
<td valign="top" width="200">80-95% savings</td>
</tr>
</tbody>
</table>
<p>These numbers come straight from a vendor and these tests may be somewhat optimized for better results.<br />
<em>* As an economy teacher of mine always said:”You give me raw data and the results you want to come out of it, and I’ll provide you a calculation that offers the results you want…”.</em></p>
<p>Nevertheless these are some pretty impressive numbers! I would love to test this in a production environment and hopefully see the eyes of some IT guys grow, aswell as the smiles of IT managers, when they see the storage savings in their environment <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile3.png" alt="Smile" /></p>
<p>But what about the performance? Any dedupe technology causes some sort of a performance hit, right?<br />
Yeah, that’s true… also with the dedupe in Windows Server 8.<br />
Microsoft has offered some information about this.<br />
Write actions have no direct performance hit since the dedupe process is done in the background when the system is idle.<br />
Read actions do have a performance hit, around 3% when the file is not in cache.</p>
<p><em><strong>The components of deduplication</strong></em><br />
Drivers are always ‘fun’ to troubleshoot and since the entire technology of deduplication in Windows Server 8 is based on the filter driver, some understanding of the thing may be useful.</p>
<p><a href="http://jeffwouters.nl/wp-content/uploads/2012/01/image2.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://jeffwouters.nl/wp-content/uploads/2012/01/image_thumb2.png" alt="image" width="449" height="356" border="0" /></a></p>
<p>To do this, we have to look at the technology from an architectural view. Where the management of dedupe can be done by Server Manager, PowerShell and WMI, it only manages the dedupe service which in its turn manages the dedupe jobs.<br />
Those dedupe jobs are the ones that talk to the dedupe filter driver that does the actual handling of the chunks of data on the file system. But when data is only stored once, the files will have to know where their data has gone to. That’s where the metadata comes in to play since this is where the location of all the bits and bytes is stored.<br />
With ‘normal files the metadata will only have references to the regular storage. But when a file is affected by the dedupe process, the metadata will not only refer to the regular storage but also to some chunks in the chunk store.<br />
The dedupe service can be scheduled or can run in a background mode while it waits for the system to enter an idle mode so that the system will not experience a negative performance in production hours. This is also called a post-process dedupe mode.</p>
<p><strong><em>Dedupe and the GUI<br />
</em></strong>The basic management features for dedupe are available in the GUI. Let’s do a quick walkthrough for enabling and configuring the dedupe feature in Windows Server 8.</p>
<p>After installing the File Services role, add the Data Deduplication feature to that role:<br />
<a href="http://jeffwouters.nl/wp-content/uploads/2012/01/image3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://jeffwouters.nl/wp-content/uploads/2012/01/image_thumb3.png" alt="image" width="452" height="387" border="0" /></a></p>
<p>Next, you can configure dedupe on a volume:<br />
<a href="http://jeffwouters.nl/wp-content/uploads/2012/01/image4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://jeffwouters.nl/wp-content/uploads/2012/01/image_thumb4.png" alt="image" width="538" height="247" border="0" /></a></p>
<p>Now we get the option to configure some settings in dedupe, such as files and folders to exclude… but more interesting is the setting for the minimum amount of days a file must not been changed for the dedup process to pick up this file:<br />
<a href="http://jeffwouters.nl/wp-content/uploads/2012/01/image5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" src="http://jeffwouters.nl/wp-content/uploads/2012/01/image_thumb5.png" alt="image" width="447" height="341" border="0" /></a></p>
<p><strong><em>Dedupe and PowerShell</em></strong><br />
To enable dedupe we have to use my favorite tool: PowerShell.<br />
The first task is add the deduplication feature which is part of the file system role. This can be done by using the Server Manager (GUI)… but where’s the fun in that? You can’t automate that… but by using PowerShell you can <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile3.png" alt="Smile" /><br />
To enable the deduplication feature by using (elevated) PowerShell commands:</p>
<blockquote><p><em>Import-Module ServerManager<br />
Add-WindowsFeature -name FS-Data-Deduplication</em></p></blockquote>
<p>Now that the deduplication feature has been enabled, we can start configuring.<br />
First, as with any other PowerShell module, we have to load the module. You can do this with the following command:</p>
<blockquote><p><em>Import-Module Deduplication </em></p></blockquote>
<p>To configure the dedupe feature on volume E on a device:</p>
<blockquote><p><em>Enable-DedupVolume E:</em></p></blockquote>
<p>Now that dedupe has been enabled and configured on a volume, we want to know some statistics such as what amount of storage we actually saved by using dedupe:</p>
<blockquote><p><em>Get-DedupStatus</em></p></blockquote>
<p>By default, the dedupe process will only affect files that have not been changed for 30 days. Especially in demo environments this can be a nasty gotcha… you probably don’t want to wait 30+ days for dedupe to start doing its thing…<br />
So, to change this value to 0 (process the file a.s.a.p.) you can use the following command:</p>
<blockquote><p><em>Set-DedupVolume E: -MinimumFileAgeDays 0</em></p></blockquote>
<p>Normally the dedupe process is done through scheduled tasks in the Windows operating system… but you can start this process manually with PowerShell:</p>
<blockquote><p><em>Start-DedupJob E: –Type Optimization</em></p></blockquote>
<p>However, this job runs in the background and may take some time. To view the status of that job, the following command can be used:</p>
<blockquote><p><em>Get-DedupJob</em></p></blockquote>
<p><strong>HELP!!!</strong> I’ve done something wrong and I have to disable dedupe on this volume!!<br />
Don’t get your nickers in a twist… again, this can be done by using PowerShell <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile3.png" alt="Smile" /> Use this command to un-dedupe the volume:</p>
<blockquote><p><em>Start-DedupJob -Volume E: -Type Unoptimization</em></p></blockquote>
<p><span style="font-size: small;">If you are as enthusiastic about this feature as I am you can read the help for the dedupe PowerShell cmdlets by using this command:</span></p>
<blockquote><p><em><span style="font-size: small;">Help Dedup</span></em></p></blockquote>
<div class="shr-publisher-637"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Data+Deduplication+in+Windows+8+explained+from+A+to+Z+http%3A%2F%2Fjeffwouters.nl%2F%3Fp%3D637" title="Post to Twitter"><img class="nothumb" src="http://jeffwouters.nl/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://jeffwouters.nl/index.php/2012/01/disk-deduplication-in-windows-8-explained-from-a-to-z/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>RES Workspace Manager &#8211; Outlook 2010 always starts with a first run wizard</title>
		<link>http://jeffwouters.nl/index.php/2012/01/res-workspace-manager-outlook-2010-always-starts-with-a-first-run-wizard/</link>
		<comments>http://jeffwouters.nl/index.php/2012/01/res-workspace-manager-outlook-2010-always-starts-with-a-first-run-wizard/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 14:45:18 +0000</pubDate>
		<dc:creator>Jeff Wouters</dc:creator>
				<category><![CDATA[RES Software]]></category>

		<guid isPermaLink="false">http://jeffwouters.nl/?p=620</guid>
		<description><![CDATA[Problem Symptom 1: Microsoft Outlook (2010) does not remember the mail profile when logging on for a second time. Symptom 2: Every time Outlook starts for the first time in a session, it comes with a “First run”-wizard. Cause Outlook can be forced to run the “First run”-wizard every first time Outlook is started. When [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:right;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fres-workspace-manager-outlook-2010-always-starts-with-a-first-run-wizard%2F' data-shr_title='RES+Workspace+Manager+-+Outlook+2010+always+starts+with+a+first+run+wizard'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fres-workspace-manager-outlook-2010-always-starts-with-a-first-run-wizard%2F' data-shr_title='RES+Workspace+Manager+-+Outlook+2010+always+starts+with+a+first+run+wizard'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><strong>Problem</strong><br />
Symptom 1: Microsoft Outlook (2010) does not remember the mail profile when logging on for a second time.<br />
Symptom 2: Every time Outlook starts for the first time in a session, it comes with a “First run”-wizard.<br />
<img src="http://support.microsoft.com/Library/Images/2592153.JPG" alt="" width="544" height="374" /></p>
<p><strong>Cause<br />
</strong>Outlook can be forced to run the “First run”-wizard every first time Outlook is started. When using mandatory profiles, the configuration chance to the user profile will not be saved and when a user starts a new session, Outlook will think the “First run”- wizard has not been run yet.</p>
<p><strong>Workaround</strong><br />
Don’t use mandatory profiles.</p>
<p><strong>Resolution</strong><br />
Remove the following registry keys from your installation:</p>
<blockquote><p>HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office\14.0\User Settings\{C22A96AB-A00C-4A3D-9545-42B4C0005809}\Create\software\microsoft\office\14.0\outlook\Setup<br />
&#8220;ImportPRF&#8221;=&#8221;C:\\PROGRA~2\\MICROS~1\\custom14.prf”<br />
”First-Run&#8221;=”hex:00,00,00,00,00,00,00,00”</p></blockquote>
<p>The registry key for “custom14.prf” is also described in KB242642 in the <a href="http://kb.ressoftware.com">RES Software Knowledge Base</a>, but without the removal of the “First-Run” key it did not solve my customers issue.</p>
<p><em>Note: This only applies in environments where mandatory profiles are used.</em></p>
<div class="shr-publisher-620"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=RES+Workspace+Manager+%E2%80%93+Outlook+2010+always+starts+with+a+first+run+wizard+http%3A%2F%2Fjeffwouters.nl%2F%3Fp%3D620" title="Post to Twitter"><img class="nothumb" src="http://jeffwouters.nl/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://jeffwouters.nl/index.php/2012/01/res-workspace-manager-outlook-2010-always-starts-with-a-first-run-wizard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Video interviews with some Hyper-V experts</title>
		<link>http://jeffwouters.nl/index.php/2012/01/video-interviews-with-some-hyper-v-experts/</link>
		<comments>http://jeffwouters.nl/index.php/2012/01/video-interviews-with-some-hyper-v-experts/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 09:04:46 +0000</pubDate>
		<dc:creator>Jeff Wouters</dc:creator>
				<category><![CDATA[Hyper-V]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SCVMM]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://jeffwouters.nl/?p=616</guid>
		<description><![CDATA[Last November I went to the Experts 2 Experts Virtualization Conference in London where I met some other Hyper-V enthusiasts. One of them was Carsten Rachfahl (MVP Virtual Server) who does frequent video interviews with leading experts in the Microsoft IT community. He asked a bunch of us if he could interview us which all [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:right;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fvideo-interviews-with-some-hyper-v-experts%2F' data-shr_title='Video+interviews+with+some+Hyper-V+experts'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fvideo-interviews-with-some-hyper-v-experts%2F' data-shr_title='Video+interviews+with+some+Hyper-V+experts'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Last November I went to the <a href="http://www.pubforum.info/pubforum/Home.aspx">Experts 2 Experts Virtualization Conference</a> in London where I met some other Hyper-V enthusiasts.<br />
One of them was <a href="http://www.hyper-v-server.de">Carsten Rachfahl</a> (MVP Virtual Server) who does frequent video interviews with leading experts in the Microsoft IT community. He asked a bunch of us if he could interview us which all of us were happy to do <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile2.png" alt="Smile" /></p>
<p>First up was <a href="http://www.aidanfinn.com">Aidan Finn</a> (MVP Virtual Server). Aidan also did two presentations at the event, one about what he could tell us about Hyper-V 3.0 and one about designing your backup solution when using Hyper-V Cluster Shared Volumes (CSV) which were both very interesting… His interview is also about designing Hyper-V CSV and Backup:<br />
<a title="http://www.it-cast.de/alle/videointerview-with-aidan-finn-about-hyper-v-csv-and-backup/" href="http://www.it-cast.de/alle/videointerview-with-aidan-finn-about-hyper-v-csv-and-backup/">http://www.it-cast.de/alle/videointerview-with-aidan-finn-about-hyper-v-csv-and-backup/</a></p>
<p>Carsten’s second victim was <a href="http://workinghardinit.wordpress.com/">Didier van Hoye</a> (MVP Virtual Server since this month… congrats Didier!). Didier did a presentation at the event about 10GB networking in Hyper-V and found this to be very educational <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile2.png" alt="Smile" /><br />
His interview is about Cluster Shared Volumes and Storage design in Windows 8:<br />
<a title="http://www.it-cast.de/alle/videointerview-with-didier-van-hoye-about-csv-and-storage-design/" href="http://www.it-cast.de/alle/videointerview-with-didier-van-hoye-about-csv-and-storage-design/">http://www.it-cast.de/alle/videointerview-with-didier-van-hoye-about-csv-and-storage-design/</a></p>
<p>Third up was <a href="http://www.virtualfat.com">Ronnie Isherwood</a> who lives in Jersey (no, not that city in the USA but that small island between the UK and France…). Ronnie also did a presentation at the event, about System Center Virtual Machine Manager (SCVMM) 2012 although I had to leave in the middle of the presentation because a colleage contacted me from back home (The Netherlands) with a critical issue and needed some advice. So, altough I was unable to see most of Ronnie’s presentation I heard it was a good one (didn’t expected anything else though <img class="wlEmoticon wlEmoticon-winkingsmile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-winkingsmile.png" alt="Winking smile" />).<br />
His interview with Carsten is about SCVMM 2012, among others it’s multi-hypervisor support:<br />
<a title="http://www.it-cast.de/alle/videointerview-with-ronnie-isherwood-virtual-machine-manager-2012/" href="http://www.it-cast.de/alle/videointerview-with-ronnie-isherwood-virtual-machine-manager-2012/">http://www.it-cast.de/alle/videointerview-with-ronnie-isherwood-virtual-machine-manager-2012/</a></p>
<p>And the fourth person able to get in from of the camera was… me <img class="wlEmoticon wlEmoticon-hotsmile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-hotsmile.png" alt="Hot smile" />. I did a presentation at the event about the v-Alliance from Microsoft and Citrix, which was my first presentation at an international IT event.<br />
My interview on the other hand was about the combination of my two favorites: Hyper-V and PowerShell:<br />
<a title="http://www.it-cast.de/alle/videointerview-with-jeff-wouters-about-powershell/" href="http://www.it-cast.de/alle/videointerview-with-jeff-wouters-about-powershell/">http://www.it-cast.de/alle/videointerview-with-jeff-wouters-about-powershell/</a></p>
<p>And to close a few days of deep technical sessions, meeting community peers and of course a lot of fun, we did a group interview (featuring all of the above) about our favorite Hyper-V feature in Windows 8:<br />
<a title="http://www.it-cast.de/alle/videointerview-what-is-your-favorite-windows-8-feature/" href="http://www.it-cast.de/alle/videointerview-what-is-your-favorite-windows-8-feature/">http://www.it-cast.de/alle/videointerview-what-is-your-favorite-windows-8-feature/</a></p>
<p>During the entire event we’ve talked with each other about a lot of things… and I’m hoping some of the ideas will come to see the light of day in 2012… I’ll keep you posted <img class="wlEmoticon wlEmoticon-openmouthedsmile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-openmouthedsmile.png" alt="Open-mouthed smile" /></p>
<div class="shr-publisher-616"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Video+interviews+with+some+Hyper-V+experts+http%3A%2F%2Fjeffwouters.nl%2F%3Fp%3D616" title="Post to Twitter"><img class="nothumb" src="http://jeffwouters.nl/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://jeffwouters.nl/index.php/2012/01/video-interviews-with-some-hyper-v-experts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Immidio launches their Application Profiler product</title>
		<link>http://jeffwouters.nl/index.php/2012/01/immidio-launches-their-application-profiler-product/</link>
		<comments>http://jeffwouters.nl/index.php/2012/01/immidio-launches-their-application-profiler-product/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 08:20:41 +0000</pubDate>
		<dc:creator>Jeff Wouters</dc:creator>
				<category><![CDATA[Immidio]]></category>

		<guid isPermaLink="false">http://jeffwouters.nl/?p=610</guid>
		<description><![CDATA[The first time I started using Immidio Flex Profiles I immediately noticed one challenge in particular… The settings for every single application needed to be configured manually. Since most people don’t know how their applications work, and me as a consultant that is only with a customer for a short time doesn’t know anything about [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:right;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fimmidio-launches-their-application-profiler-product%2F' data-shr_title='Immidio+launches+their+Application+Profiler+product'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fimmidio-launches-their-application-profiler-product%2F' data-shr_title='Immidio+launches+their+Application+Profiler+product'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><font size="3" face="Arial">The first time I started using Immidio Flex Profiles I immediately noticed one challenge in particular… The settings for every single application needed to be configured manually. Since most people don’t know how their applications work, and me as a consultant that is only with a customer for a short time doesn’t know anything about the internal workings of their applications, this can be a very time intrusive job…</font></p>
<p><font size="3" face="Arial">Immidio recognized this issue, started thinking and developing… and within Flex Profiles 7.0 they came up with the Flex Profiles Assistant. Although this made the creating of the Flex Config files much easier, still a lot of manual activities were required.</font></p>
<p><font size="3" face="Arial">Somewhere this month (January 2012) Immidio will release their Application Profiler product, which will be licensed as a component for Flex Profiles 7.5. This product makes the creating of Flex Config files much easier!     <br />With this product the steps for creating a Flex Config file will be:</font></p>
<ol>
<li><font size="3" face="Arial">Start the Immidio Application Profiler.</font></li>
<li><font size="3" face="Arial">Start your application from within the (user friendly) interface.</font></li>
<li><font size="3" face="Arial">After the application is analyzed, save the optimized Flex Config file.</font></li>
<li><font size="3" face="Arial">Import the Flex Config file into Immidio Flex Profiles.</font></li>
</ol>
<p><font size="3" face="Arial">And you’re done <img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile1.png" /></font></p>
<p><font size="3" face="Arial">But, there is more… Flex Profiles provides the feature of “predefined settings”. This means that you can configure some predefined settings for an application which will, for example, enforce the reading pane for Windows Explorer to be set to “details”.     <br />Creating such predefined settings for applications can be a the most time consuming task of an entire Immidio implementation.      <br />Immidio also recognized this issue and provides a solution to automate this process within the Application Profiler product. With this, you can start your application, set it to the defined settings you want, generate the file with those predefined settings and import this into Flex Profiles… much faster compared to ‘the old way’.</font></p>
<p><font size="3" face="Arial">Interested? Take a look at the YouTube video which Immidio has placed online showing the Immidio Application Profiler product: </font>
<div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:c290b2ab-ce3e-4bc1-b991-b817676685ec" class="wlWriterEditableSmartContent">
<div><object width="448" height="252"><param name="movie" value="http://www.youtube.com/v/EKoIOtdoCkM?hl=en&amp;hd=1"></param><embed src="http://www.youtube.com/v/EKoIOtdoCkM?hl=en&amp;hd=1" type="application/x-shockwave-flash" width="448" height="252"></embed></object></div>
</div>
<p><font size="3" face="Arial"></font></p>
<div class="shr-publisher-610"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=Immidio+launches+their+Application+Profiler+product+http%3A%2F%2Fjeffwouters.nl%2F%3Fp%3D610" title="Post to Twitter"><img class="nothumb" src="http://jeffwouters.nl/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://jeffwouters.nl/index.php/2012/01/immidio-launches-their-application-profiler-product/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell&#8211;The &#8220;unexpected token &#8216;and&#8217;&#8221; error message explained</title>
		<link>http://jeffwouters.nl/index.php/2012/01/powershellthe-unexpected-token-and-error-message-explained/</link>
		<comments>http://jeffwouters.nl/index.php/2012/01/powershellthe-unexpected-token-and-error-message-explained/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 09:01:50 +0000</pubDate>
		<dc:creator>Jeff Wouters</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://jeffwouters.nl/?p=604</guid>
		<description><![CDATA[Lots of people that are used scripting languages, such as VBS or Kix, and start using PowerShell contact me about the infamous “Unexpected token ‘and’” error message. I found this to be funny because I ran into that one myself in my early PowerShell days So, lets go back in time to the point where [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><div class='shareaholic-like-buttonset' style='float:right;height:30px;'><a class='shareaholic-fblike' data-shr_layout='button_count' data-shr_showfaces='false' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fpowershellthe-unexpected-token-and-error-message-explained%2F' data-shr_title='PowerShell%26ndash%3BThe+%26ldquo%3Bunexpected+token+%26lsquo%3Band%26rsquo%3B%26rdquo%3B+error+message+explained'></a><a class='shareaholic-googleplusone' data-shr_size='medium' data-shr_count='true' data-shr_href='http%3A%2F%2Fjeffwouters.nl%2Findex.php%2F2012%2F01%2Fpowershellthe-unexpected-token-and-error-message-explained%2F' data-shr_title='PowerShell%26ndash%3BThe+%26ldquo%3Bunexpected+token+%26lsquo%3Band%26rsquo%3B%26rdquo%3B+error+message+explained'></a></div><div style="clear: both; min-height: 1px; height: 3px; width: 100%;"></div><!-- End Shareaholic LikeButtonSetTop Automatic --><p><span style="font-family: Arial; font-size: small;">Lots of people that are used scripting languages, such as VBS or Kix, and start using PowerShell contact me about the infamous “Unexpected token ‘and’” error message.<br />
I found this to be funny because I ran into that one myself in my early PowerShell days <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile.png" alt="Smile" /><br />
So, lets go back in time to the point where I was just started using PowerShell and was playing around with it…</span></p>
<p><span style="font-family: Arial; font-size: small;">When creating a PowerShell script to find a file based on some criteria, my way of thinking would provide something like this:</span></p>
<blockquote><p><span style="font-family: Arial; font-size: small;">$MSI = get-childitem $TargetPath –recurse | where ({$_.Extension -match &#8220;msi&#8221;} and {$_.Name -match &#8220;LiveMessenger&#8221;})</span></p></blockquote>
<p><span style="font-family: Arial; font-size: small;">But&#8230; it will give an error stating that there is an &#8220;unexpected token &#8216;and&#8217;&#8221;&#8230; very annoying.<br />
Since I was used to scripting in VBS, Batch and Kix I thought this was very strange, the syntax should have worked, right? Wrong&#8230;<br />
PowerShell is an object based scripting language so a little bit of thinking needs to be changed, compared to what I would like to call &#8216;VBS thinking&#8217;.</span></p>
<p><span style="font-family: Arial; font-size: small;">With PowerShell it is possible to use the output of a first command as the input of the command that comes after it by using a technique called &#8216;piping&#8217;.<br />
So, instead of using an &#8216;and&#8217; statement, we could simply use the output of the first filter command as the input of the second filter command.<br />
With this in mind, a change can be made. The following command uses the piping technique instead of an &#8216;and&#8217; statement&#8230; and will work without that nasty &#8220;unexpected token &#8216;and&#8217;&#8221; error. Why? Simply because the &#8216;and&#8217; statement is not being used anymore.</span></p>
<blockquote><p><span style="font-family: Arial; font-size: small;">$MSI = get-childitem $TargetPath –recurse | where {$_.Extension -match &#8220;msi&#8221;} | where {$_.Name -match &#8220;LiveMessenger&#8221;}</span></p></blockquote>
<p><span style="font-family: Arial; font-size: small;">And by using the piping technique, you can simply go even further and, if you would like that, you can filter even further!<br />
Next to not getting an error, the piping technique is very CPU friendly compared to the &#8216;and&#8217; statement.<br />
The &#8216;and&#8217; statement would cause the entire criteria to be tested on every single object, where the piping technique filters down the objects at every step which causes the list of objects for the second filter to be smaller&#8230; and so on. Far more elegant, right?</span></p>
<p><span style="font-family: Arial; font-size: small;">So, what does this all mean?<br />
If you’re used to scripting languages like VBS or Kix, PowerShell will require a little change in your thinking. Don’t think about AND statements… instead, think about piping such as shown above <img class="wlEmoticon wlEmoticon-smile" style="border-style: none;" src="http://jeffwouters.nl/wp-content/uploads/2012/01/wlEmoticon-smile.png" alt="Smile" /></span></p>
<p>&nbsp;</p>
<div class="shr-publisher-604"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic --><div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/intent/tweet?text=PowerShell%E2%80%93The+%E2%80%9Cunexpected+token+%E2%80%98and%E2%80%99%E2%80%9D+error+message+explained+http%3A%2F%2Fjeffwouters.nl%2F%3Fp%3D604" title="Post to Twitter"><img class="nothumb" src="http://jeffwouters.nl/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-micro4.png" alt="Post to Twitter" /></a></p></div>]]></content:encoded>
			<wfw:commentRss>http://jeffwouters.nl/index.php/2012/01/powershellthe-unexpected-token-and-error-message-explained/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

