<?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>Helge Klein</title>
	<atom:link href="http://blogs.sepago.de/helge/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.sepago.de/helge</link>
	<description>Helge Klein on Windows, User Profiles, Citrix and other things</description>
	<lastBuildDate>Sat, 06 Mar 2010 15:29:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<image>
    <title>Helge Klein</title>
    <url>http://blogs.sepago.de/helge/wp-content/themes/k2/styles/sepago/helge.jpg</url>
    <link>http://blogs.sepago.de/helge</link>
    <width>77</width>
    <height>87</height>
    <description>Helge Klein - http://blogs.sepago.de/helge</description>
    </image>		<item>
		<title>Poll: Do Companies Use Local or Roaming Profiles for Desktop PCs?</title>
		<link>http://blogs.sepago.de/helge/2010/03/04/poll-do-companies-use-local-or-roaming-profiles-for-desktop-pcs/</link>
		<comments>http://blogs.sepago.de/helge/2010/03/04/poll-do-companies-use-local-or-roaming-profiles-for-desktop-pcs/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 20:37:34 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[User Profiles]]></category>
		<category><![CDATA[Desktop PCs]]></category>
		<category><![CDATA[Local Profiles]]></category>
		<category><![CDATA[Poll]]></category>
		<category><![CDATA[Roaming Profiles]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1424</guid>
		<description><![CDATA[Would it shock you if 35% of all enterprises used roaming profiles on their desktop PCs? Well, that was the average I got when I asked via Twitter. But is that number correct? It might or might not be. It is based on the answers of only ten people, making it hardly statistically relevant. In [...]]]></description>
			<content:encoded><![CDATA[<p>Would it shock you if 35% of all enterprises used roaming profiles on their desktop PCs? Well, that was the average I got when I asked via Twitter. But is that number correct? It might or might not be. It is based on the answers of only ten people, making it hardly statistically relevant. In the resulting discussion that was a topic, too. The obvious next step, suggested by Kimmo Jernstrom, is to ask more people. So here is the poll.<span id="more-1424"></span></p>
<h3>Poll &#8211; Please Vote</h3>
<p>I am interested in the distribution between local and roaming profiles on corporate desktop computers. I am explicitly referring to <strong>traditional desktops only</strong>, so no laptops, no Terminal Servers, no virtual desktops (VDI), etc.</p>
<p>Please vote based on your personal experiences only, in other words what you <em>know</em> is out there, not what you <em>think</em> there is. Thank you.</p>
Note: There is a poll embedded within this post, please visit the site to participate in this post's poll.
<p>Feel free to comment below. The more opinions, the more interesting this gets.</p>
<h3>Twitter Poll and Discussion</h3>
<p>Here is the Twitter communication that led to this poll.</p>
<p><strong>Question:</strong></p>
<p><a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a>: Do companies typically use roaming or local user profiles for desktop PC users? What are your experiences? Thanks for a quick reply!</p>
<p><strong>Answers:</strong></p>
<p><a href="http://twitter.com/scotty11x" target="_blank">@scotty11x</a>: RT <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a>: Do companies typically use roaming or local user profiles for desktop PC users?&gt;&gt;&gt; local at most of my customers<br />
<a href="http://twitter.com/tellmers" target="_blank">@tellmers</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> local user profiles<br />
<a href="http://twitter.com/JimMoyle" target="_blank">@JimMoyle</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> roaming almost exclusively<br />
<a href="http://twitter.com/gilwood_cs" target="_blank">@gilwood_cs</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> roaming profiles: typically its rarely thought through so its developed into a slow and painful mess thats become &#8216;acceptable&#8217;<br />
<a href="http://twitter.com/timarenz" target="_blank">@timarenz</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> Most of our customers are using local user profiles in their traditional (local) desktop environment.<br />
<a href="http://twitter.com/ralf_hoffmann" target="_blank">@ralf_hoffmann</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> meine Erfahrung: 40% nutzen roaming profiles, 20% nutzen Folder redirection, 40% machen lokale profile<br />
<a href="http://twitter.com/stevegreenberg" target="_blank">@stevegreenberg</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> Our customers mostly use roaming profiles and then local. When we are done they are usually flex or appsense<br />
<a href="http://twitter.com/KimmoJernstrom" target="_blank">@KimmoJernstrom</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> Local profiles for Desktops<br />
<a href="http://twitter.com/Knoerre" target="_blank">@Knoerre</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> Many people think that roaming profiles don&#8217;t work at all because of the trouble they get without folder redirection&#8230;<br />
<a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> typically I see local. Sometimes with appdata redir (sadly)</p>
<p><strong>Discussion following the answers:</strong></p>
<p><a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a>: My question on roaming vs. local user profiles on corporate PCs: I got 10 answers. On average: 65% roaming, 35% local. Thanks everybody! <em>Note: As you may have noticed I confused the numbers: it should have been 65% local and 35% roaming.</em><br />
<a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> I&#8217;m really shocked the number of responses to roaming was so high. Was there a demographic difference? US vs EU?<br />
<a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a>: <a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a> Roaming/local difference between EU/US? Could be, good point. From the answers I got, roaming is mostly used in Europe&#8230;<br />
<a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> Aha! That&#8217;s exactly what I expected to find.<br />
<a href="http://twitter.com/KimmoJernstrom" target="_blank">@KimmoJernstrom</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> <a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a> Hey, there were 10 responses (sic). http://en.wikipedia.org/wiki/Statistics<br />
<a href="http://twitter.com/JimMoyle" target="_blank">@JimMoyle</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> <a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a> Interesting, maybe due to greater pressure on space in EU hotdeking is much more prevalent, hence more roamin<br />
<a href="http://twitter.com/JimMoyle" target="_blank">@JimMoyle</a>: RT <a href="http://twitter.com/KimmoJernstrom" target="_blank">@KimmoJernstrom</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a> <a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a> Hey, there were 10 responses (sic). Ahhh but you could consider those 10 as a meta study :)<br />
<a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a>: RT <a href="http://twitter.com/KimmoJernstrom" target="_blank">@KimmoJernstrom</a>: <a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a> Hey, there were 10 responses (sic). http://bit.ly/JVjL2 &lt;= I know, statistically not relevant, number too low<br />
<a href="http://twitter.com/KimmoJernstrom" target="_blank">@KimmoJernstrom</a>: <a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a>: <a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a> <a href="http://twitter.com/JimMoyle" target="_blank">@JimMoyle</a>. I do believe the numbers match up. Guys, build a web quiz on the topic. This is interesting. Really.<br />
<a href="http://twitter.com/gilwood_cs" target="_blank">@gilwood_cs</a>: <a href="http://twitter.com/JimMoyle" target="_blank">@JimMoyle</a><a href="http://twitter.com/HelgeKlein" target="_blank">@HelgeKlein</a><a href="http://twitter.com/shawnbass" target="_blank">@shawnbass</a> maybe we&#8217;ve found root cause for US&#8217;s growing obesity prob: US admins not implementing roaming profiles :?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/03/04/poll-do-companies-use-local-or-roaming-profiles-for-desktop-pcs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>.NET Applications on Windows x64 &#8211; Easy? Yes and No</title>
		<link>http://blogs.sepago.de/helge/2010/03/02/net-applications-on-windows-x64-easy-yes-and-no/</link>
		<comments>http://blogs.sepago.de/helge/2010/03/02/net-applications-on-windows-x64-easy-yes-and-no/#comments</comments>
		<pubDate>Tue, 02 Mar 2010 21:33:01 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[64-Bit Windows (x64)]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Assembly]]></category>
		<category><![CDATA[Managed]]></category>
		<category><![CDATA[Unmanaged]]></category>
		<category><![CDATA[x64]]></category>
		<category><![CDATA[x86]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1410</guid>
		<description><![CDATA[When migrating to 64-bit Windows, traditional &#8220;unmanaged&#8221; applications can pose challenges. That is because unmanaged binaries contain hardware-dependent CPU instructions &#8211; and the view on the hardware differs between 32- and 64-bit mode. But .NET? It should be unaffected of a system&#8217;s bitness since &#8220;managed&#8221; binaries contain instructions in a so-called intermediate language that is [...]]]></description>
			<content:encoded><![CDATA[<p>When migrating to 64-bit Windows, traditional &#8220;unmanaged&#8221; applications can <a href="http://blogs.sepago.de/helge/2008/04/02/windows-x64-all-the-same-yet-very-different-part-6/" target="_blank">pose challenges</a>. That is because unmanaged binaries contain hardware-dependent CPU instructions &#8211; and the view on the hardware differs between 32- and 64-bit mode. But .NET? It should be unaffected of a system&#8217;s bitness since &#8220;managed&#8221; binaries contain instructions in a so-called intermediate language that is executed in a virtual machine at run-time and only then translated to machine language. But is it really? This article is about .NET programs that <em>are</em> dependent on OS bitness.<span id="more-1410"></span></p>
<h3>The Default</h3>
<p>When you create a new C# or VB application in Visual Studio it is created as a bitness-independent program by default. That means that it will run as a 32-bit process on 32-bit Windows, and as a 64-bit process on 64-bit Windows, optimally leveraging each platform&#8217;s capabilities. That sounds good, and indeed it is a great achievement of the .NET framework to make this possible. But there are caveats, otherwise this article would be quite pointless.</p>
<h3>Under the Hood</h3>
<p>Each .NET binary (correct: assembly, an EXE or DLL) stores flags marking it as compiled for either:</p>
<ul>
<li>
		AnyCPU [default]
	</li>
<li>
		x86
	</li>
<li>
		x64
	</li>
</ul>
<p>There is also Itanium, but let us ignore that <a href="http://blogs.sepago.de/helge/2009/03/17/itanium-ia-64-an-obituary/">soon-to-be obsolete</a> platform.</p>
<p>These flags are relevant at runtime. AnyCPU assemblies are independent of the OS bitness. AnyCPU DLLs can be loaded into 32-bit and 64-bit processes while AnyCPU EXEs are started as 32-bit processes on Windows x86 and as 64-bit processes on Windows x64.</p>
<p>x86 assemblies can be loaded into 32-bit processes only (DLLs) respectively are always started as 32-bit processes (EXEs).</p>
<p>x64 assemblies can be loaded into 64-bit processes only (DLLs) respectively are always started as 64-bit processes (EXEs).</p>
<h3>Why the Distinction?</h3>
<p>The obvious question at this point: why even create three different types of .NET assemblies if .NET code is platform-independent? The answer is simple: While .NET code <em>is</em> platform-independent, legacy code is <em>not</em>. And a lot of .NET applications rely on unmanaged code.</p>
<p>Consider the following (fictional) scenario: You are writing a nice program for transferring files from one computer system to another. At some point you discover that compressing the files transferred by your program would greatly enhance speed and usability. So you decide to compress files. But how? Write a packing algorithm yourself? No way! The easiest solution is to use something existing. So you might end up with the free 6-zip library, written in unmanaged C++ and available as 32-bit only. And here the problem starts.</p>
<p>You call the packing routines from the unmanaged 32-bit DLL, test very thoroughly on your 32-bit develepment machine (where everything works great) and deliver the resulting application to your customers. Another job well done! But then one of your customers decides to migrate his systems to Windows x64 &#8211; and discovers that your application does not work there.</p>
<p>Why? On 64-bit Windows your AnyCPU assembly runs as a 64-bit process &#8211; and a 64-bit process cannot load 32-bit DLLs. But your application tries to do exactly that and fails.</p>
<h3>What to Do &#8211; As a Programmer</h3>
<p>If you are the guy developing the application, you have two options if you want your program to run on both 32-bit and 64-bit Windows:</p>
<ul>
<li>
		Compile your managed code as &#8220;AnyCPU&#8221; but have the installer determine that target system&#8217;s bitness and install any unmanaged DLLs in the appropriate bitness. This means you need additional logic during setup.
	</li>
<li>
		Compile your managed code as &#8220;x86&#8243; &#8211; that way it will always run as a 32-bit process, regardless of the bitness of the OS. Since your code is always 32-bit, it is safe to only distribute 32-bit versions of unmanaged DLLs.
	</li>
</ul>
<h3>What to Do &#8211; As an Administrator</h3>
<p>If you want to get the application to run on 64-bit Windows, the safest way to do so would be to contact the vendor and ask him to make his software compatible with x64. Only by going back to the vendor will your configuration be supported, which is a requirement especially in larger enterprises.</p>
<p>If vendor support is not paramount you can try the following hack. It is made possible by the fact that all three flavors of .NET assemblies described above are basically identical except for two flags in the PE header of the binary file storing whether this is a x86, x64 or AnyCPU assembly. And flags can be changed easily&#8230;</p>
<p>First of all you might want to check your .NET assemblies. There are <a href="http://stackoverflow.com/questions/270531/how-to-determine-if-net-assembly-was-built-for-x86-or-x64" target="_blank">several ways</a> to do that:</p>
<ul>
<li>
      <a href="http://theruntime.com/blogs/brianpeek/archive/2007/11/13/x64-development-with-net.aspx" target="_blank">CorFlags.exe</a>
   </li>
<li>
      <a href="http://msdn.microsoft.com/en-us/library/system.reflection.module.getpekind.aspx" target="_blank">System.Reflection.Module.GetPEKind</a>
   </li>
<li>
      <a href="http://msdn.microsoft.com/en-us/library/system.reflection.assemblyname.getassemblyname.aspx" target="_blank">System.Reflection.AssemblyName.GetAssemblyName (use the property &#8220;ProcessorArchitecture&#8221; of the returned object)</a>
   </li>
</ul>
<p>If you find managed AnyCPU EXE files on a 64-bit system, next check if they came with unmanaged 32-bit DLLs. For that you first need to determine whether a DLL is managed or unmanaged, which can be done with CorFlags.exe (see above) &#8211; it will complain if it is fed an unmanaged binary. Secondly you need to check if your unmanaged DLL is 32-bit or 64-bit &#8211; information that, again, is stored in the PE header. So you need a PE header dumper like <a href="http://www.wheaty.net/downloads.htm" target="_blank">PEDump</a> from Matt Pietrek, an oldie but goldie. Unfortunately it crashes when analyzing 64-bit DLLs on 64-bit Windows 7, but only after printing the information we are interested in:</p>
<div class="codesnip-container" >D:\Tools\PEDump&gt;PEDUMP.exe c:\Windows\notepad.exe<br />
Dump of file C:\WINDOWS\NOTEPAD.EXE</p>
<p>File Header<br />
  Machine:                      8664 (unknown)              &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; This means &#8220;x64&#8243;<br />
  Number of Sections:           0006<br />
  TimeDateStamp:                4A5BC9B3 -&gt; Tue Jul 14 01:56:35 2009<br />
  &#8230;</p>
<p>D:\PEDump&gt;PEDUMP.exe c:\Windows\syswow64\notepad.exe<br />
Dump of file C:\WINDOWS\SYSWOW64\NOTEPAD.EXE</p>
<p>File Header<br />
  Machine:                      014C (i386)<br />
  Number of Sections:           0004<br />
  TimeDateStamp:                4A5BC60F -&gt; Tue Jul 14 01:41:03 2009<br />
  &#8230;</p></div>
<p>Once you have verified that you indeed have a managed EXE compiled as AnyCPU that needs 32-bit unmanaged DLLs, you can <a href="http://blogs.intesoft.net/post/2007/12/Running-NET-Apps-in-32-bit-mode-on-64-bit-Windows.aspx" target="_blank">change the EXE&#8217;s type</a> from AnyCPU to x86 with CorFlags:</p>
<div class="codesnip-container" >CoreFlags.exe TheApp.exe /32BIT+</div>
<p>If you want to revert:</p>
<div class="codesnip-container" >CoreFlags.exe TheApp.exe /32BIT-</div>
<p>Please note that modifying a binary file invalidates its digital signature (if available). Reverting back to the original state reverses this &#8211; the signature is valid once again.</p>
<h3>References</h3>
<p>MSDN: <a href="http://msdn.microsoft.com/en-us/library/ms973190.aspx" target="_blank">Migrating 32-bit Managed Code to 64-bit</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/03/02/net-applications-on-windows-x64-easy-yes-and-no/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Citrix User Profile Manager 5 Years Ago: Birth</title>
		<link>http://blogs.sepago.de/helge/2010/02/25/citrix-user-profile-manager-5-years-ago-birth/</link>
		<comments>http://blogs.sepago.de/helge/2010/02/25/citrix-user-profile-manager-5-years-ago-birth/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 22:07:05 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[User Profiles]]></category>
		<category><![CDATA[Citrix]]></category>
		<category><![CDATA[sepago]]></category>
		<category><![CDATA[User Profile Manager]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1398</guid>
		<description><![CDATA[Citrix User Profile Manager is pretty well-known in the SBC space today. Five years ago, things were quite different. Citrix did not have a user profile solution, and neither did sepago. But we had an idea spinning in our heads we soon came to call Smooth Profiles. Slowly that idea became code, then was renamed [...]]]></description>
			<content:encoded><![CDATA[<p>Citrix User Profile Manager is pretty well-known in the SBC space today. Five years ago, things were quite different. Citrix did not have a user profile solution, and neither did sepago. But we had an idea spinning in our heads we soon came to call <em>Smooth Profiles</em>. Slowly that idea became code, then was renamed to <em>sepagoPROFILE</em>, was acquired by Citrix and renamed again to <em>User Profile Manager</em> and then again to <em>Profile management</em> (with capital P and lower-case m!). You may have heard the latter part of the story. Here is a little something from the very beginning.<span id="more-1398"></span></p>
<p>A few days ago I stumbled upon an old notebook containing, to my surprise, the very first notes about what was to become sepago&#8217;s profile management product:</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/02/Smooth-Profiles-screen.jpg" rel="lightbox[id1398]"><img src="http://blogs.sepago.de/helge/files/2010/02/Smooth-Profiles-screen-425x600.jpg" alt="Smooth Profiles - screen" width="425" height="600" class="alignnone size-medium wp-image-1399" /></a></p>
<p>For those that either do not read German or my handwriting here is a transcript:</p>
<p><strong>Smooth Profiles</strong></p>
<p>Requirements:</p>
<ul>
<li>
		User has a mandatory profile
	</li>
<li>
		Directory on file server for storage of .reg file
	</li>
</ul>
<p>Logoff:</p>
<ul>
<li>
		If .reg file exists it is imported to HKCU\$SmoothProfile
	</li>
<li>
		Recursively iterate through HKCU and compare each key&#8217;s timestamp with %LOGONDATE%
	</li>
<li>
		If key in HKCU is newer:</p>
<ul>
<li>
				Copy subkeys (without children) and values to HKCU\$SmoothProfile
			</li>
</ul>
<li>
			Unload HKCU\$SmoothProfile to .reg file
		</li>
</li>
</ul>
<p>Please note:</p>
<ul>
<li>
		Backup and restore privileges (work around that by using a service)
	</li>
<li>
		Multiple concurrent logoffs (wait if .reg file is locked)
	</li>
</ul>
<p><em>End of transcript.</em></p>
<p>It is not dated, but it should be from April 2005.</p>
<h3>Remarks</h3>
<p>As you may have guessed from the transcript we initially thought it would be sufficient to store registry data since the relevant folders of the profiles would be redirected to a file server anyway.</p>
<p>But apart from that this first draft already shows some characteristics of the later sepagoPROFILE:</p>
<ol>
<li>
		Code everything in a Windows service, which gets us all the privileges we need and has the additional advantage of not having to modify logon scripts when deploying the solution.
	</li>
<li>
		Use the timestamps on registry keys to determine what has changed during a session.
	</li>
<li>
		Robustly handle concurrency in Terminal Server environments (multiple sessions per user).
	</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/02/25/citrix-user-profile-manager-5-years-ago-birth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Which Software Installed That Driver &#8211; And When?</title>
		<link>http://blogs.sepago.de/helge/2010/02/17/which-software-installed-that-driver-and-when/</link>
		<comments>http://blogs.sepago.de/helge/2010/02/17/which-software-installed-that-driver-and-when/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 22:52:45 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[Windows Internals]]></category>
		<category><![CDATA[Date/Time]]></category>
		<category><![CDATA[Drivers]]></category>
		<category><![CDATA[Free Tool]]></category>
		<category><![CDATA[Registry]]></category>
		<category><![CDATA[Setup]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1389</guid>
		<description><![CDATA[Installing a software that includes a driver may leave your system in an inconsistent state. If the install fails, parts may remain on the system. And if the remaining part is a driver, I get nervous &#8211; drivers are not the kind of stuff I want to have lingering around my system&#8217;s memory. Here is [...]]]></description>
			<content:encoded><![CDATA[<p>Installing a software that includes a driver may leave your system in an inconsistent state. If the install fails, parts may remain on the system. And if the remaining part is a driver, I get nervous &#8211; drivers are not the kind of stuff I want to have lingering around my system&#8217;s memory. Here is a way of identifying <em>when</em> a driver actually got installed.<span id="more-1389"></span></p>
<p>In my case, I installed, or rather tried to install, the Citrix Access Gateway (CAG) Plugin 4.6.2, a VPN client, on Windows 7 x64. That failed &#8211; the installer reported a timeout after a couple of minutes of showing a progress bar. I aborted the install, which worked, but when I rebooted the machine, it hung on shutting down. Not good.</p>
<p>After a reset I examined the system: nothing related to the CAG client, but in the properties of my network card I found something suspicious called &#8220;Deterministic Network Enhancer&#8221;:</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-1.GIF" rel="lightbox[id1389]"><img src="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-1.GIF" alt="Deterministic Network Enhancer - 1" width="377" height="474" class="alignnone size-full wp-image-1390" /></a></p>
<p>But how to know whether it came from the (partly failed) install or from something entirely else? First thought: Check the timestamp of the driver file. By searching the registry, I found the driver&#8217;s entries:</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-2.GIF" rel="lightbox[id1389]"><img src="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-2.GIF" alt="Deterministic Network Enhancer - 2" width="611" height="285" class="alignnone size-full wp-image-1391" /></a></p>
<p>To my disappointment the driver file&#8217;s dates (dne64x.sys) revealed nothing. I did not install anything in 2008 &#8211; I run Windows 7&#8230;</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-3.GIF" rel="lightbox[id1389]"><img src="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-3.GIF" alt="Deterministic Network Enhancer - 3" width="419" height="515" class="alignnone size-full wp-image-1392" /></a></p>
<p>Then I had the idea of checking the registry. Each driver has a key under <span style="font-family:'Courier New', Courier,monospace">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services</span>. And each registry key has a timestamp that gets updated whenever the key itself or a direct sub-object of the key get changed. So I only had to get the timestamp of the key <span style="font-family:'Courier New', Courier,monospace">HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\DNE</span> in order to know when that driver had been installed.</p>
<p>But&#8230; although I run the seventh incarnation of Windows its registry editor has not changed much for at least a decade. Regedit.exe has many shortcomings, one of them being that it does not show timestamps for registry keys. Luckily, other programmers are more than happy to fill the void. I found the interesting tool <a href="http://aezay.site11.com/aezay/regcmd/" target="_blank">Registry Commander</a> &#8211; one of its capabilities is to show registry key timestamps. It looks like this:</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-4.GIF" rel="lightbox[id1389]"><img src="http://blogs.sepago.de/helge/files/2010/02/Deterministic-Network-Enhancer-4-600x395.GIF" alt="Deterministic Network Enhancer - 4" width="600" height="395" class="alignnone size-medium wp-image-1393" /></a></p>
<p>And that was the answer I sought. The DNE driver was indeed installed by the CAG client. Now I can safely disable or uninstall that driver.</p>
<p>What about you? Have you used any alternative registry editors? Do you prefer them over Regedit?</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/02/17/which-software-installed-that-driver-and-when/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>New Articles, Tools, Tips and Tricks: Windows (7 and 2008 R2), PowerShell and Citrix</title>
		<link>http://blogs.sepago.de/helge/2010/02/11/new-articles-tools-tips-and-tricks-windows-7-and-2008-r2-powershell-and-citrix/</link>
		<comments>http://blogs.sepago.de/helge/2010/02/11/new-articles-tools-tips-and-tricks-windows-7-and-2008-r2-powershell-and-citrix/#comments</comments>
		<pubDate>Thu, 11 Feb 2010 00:20:33 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[Tips and Tricks, New Articles and Tools]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Application Streaming]]></category>
		<category><![CDATA[Defragmenting]]></category>
		<category><![CDATA[DFS]]></category>
		<category><![CDATA[Domain controller stickiness]]></category>
		<category><![CDATA[EdgeSight]]></category>
		<category><![CDATA[ETW]]></category>
		<category><![CDATA[Features]]></category>
		<category><![CDATA[Mandatory Profile]]></category>
		<category><![CDATA[Microsoft Knowledge Base]]></category>
		<category><![CDATA[Migration]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Printing]]></category>
		<category><![CDATA[PSExec]]></category>
		<category><![CDATA[RDP]]></category>
		<category><![CDATA[Resource Manager]]></category>
		<category><![CDATA[SConfig]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[SSD]]></category>
		<category><![CDATA[System State Analyzer]]></category>
		<category><![CDATA[UPHClean]]></category>
		<category><![CDATA[User Profile Manager]]></category>
		<category><![CDATA[User Profiles]]></category>
		<category><![CDATA[WebInterface]]></category>
		<category><![CDATA[Windows Features]]></category>
		<category><![CDATA[x64]]></category>
		<category><![CDATA[XenDesktop]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1372</guid>
		<description><![CDATA[Windows General
Good info for troubleshooting DFS-Namespaces in the MS KB: Storage locations, inconsistencies and how to deal with them.
Complex passwords and security guidelines for end users? No, thank you, says MS researcher. I agree.
Here is a hard-to-find list of MS KB article RSS feeds by product.
The free tool ADRecycleBin adds the missing GUI to the [...]]]></description>
			<content:encoded><![CDATA[<h3>Windows General</h3>
<p>Good info for troubleshooting DFS-Namespaces in the MS KB: <a href="http://support.microsoft.com/kb/977511" target="_blank">Storage locations, inconsistencies and how to deal with them</a>.</p>
<p>Complex passwords and security guidelines for end users? No, thank you, says <a href="http://research.microsoft.com/en-us/um/people/cormac/papers/2009/solongandnothanks.pdf" target="_blank">MS researcher</a>. I agree.<span id="more-1372"></span></p>
<p>Here is a hard-to-find <a href="http://support.microsoft.com/selectindex/?target=rss" target="_blank">list of MS KB article RSS feeds by product</a>.</p>
<p>The free tool <a href="http://www.overall.ca/index.php?option=com_content&amp;view=article&amp;id=40:adrecyclebin&amp;catid=15:adrecyclebinexe&amp;Itemid=64" target="_blank">ADRecycleBin</a> adds the missing GUI to the Active Directory recycle bin (which is PowerShell only, by default).</p>
<p>An extremely detailed <a href="http://blogs.msdn.com/ntdebugging/archive/2009/12/11/test.aspx" target="_blank">article</a> on Event Tracing for Windows in the NTDebugging blog.</p>
<p>José Barreto compiled a <a href="http://blogs.technet.com/josebda/archive/2009/12/30/windows-server-dfs-namespaces-reference.aspx" target="_blank">reference</a> for DFS-N (Distributed File System &#8211; Namespaces). Lots of useful links there.</p>
<p>UPHClean is <a href="http://blogs.technet.com/uphclean/archive/2010/01/06/status-of-uphclean.aspx" target="_blank">officially discontinued</a>. My tip: the beta of 2.0 should NOT be used in production and does not run on Vista and upwards.</p>
<p><a href="http://blogs.technet.com/askperf/archive/2010/01/12/an-introduction-to-the-windows-system-state-analyzer.aspx" target="_blank">Windows System State Analyzer</a> takes and compares snapshots of the entire machine. Great for checking on installers!</p>
<p><a href="http://blogs.technet.com/markrussinovich/archive/2010/01/13/3305263.aspx" target="_blank">How</a> to start any program under the SYSTEM account in session 0 on Vista/Win7 (psexec -sid does not work any more):</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/02/PSExec-Vista-Win.PNG" rel="lightbox[id1372]"><img src="http://blogs.sepago.de/helge/files/2010/02/PSExec-Vista-Win.PNG" alt="PSExec-Vista-Win" width="675" height="690" class="alignnone size-full wp-image-1383" /></a></p>
<p>.NET apps are platform independent and you can run any .NET app on x64? Think again! <a href="http://blogs.intesoft.net/post/2007/12/Running-NET-Apps-in-32-bit-mode-on-64-bit-Windows.aspx" target="_blank">Here</a> is how to do it.</p>
<p>MS AskPerf blog on the <a href="http://blogs.technet.com/askperf/archive/2010/01/19/print-driver-installation-on-32-bit-versus-64-bit-servers.aspx" target="_blank">nightmare</a> of installing 64-bit printer drivers on a 32-bit server. It is way too complicated!</p>
<p>Domain controller stickiness, its problems and the fix introduced in Vista/2008 <a href="http://msdn.microsoft.com/en-us/library/ms675983%28VS.85%29.aspx" target="_blank">explained</a> on MSDN (in Remarks)</p>
<p>A cool (albeit somewhat dangerous) way to <a href="http://support.citrix.com/article/CTX119337" target="_blank">copy an in-use Windows user profile</a> employing shadow copies / hobocopy.</p>
<h3>Windows 7 and Server 2008 R2</h3>
<p><a href="http://blogs.technet.com/filecab/archive/2009/11/25/windows-7-disk-defragmenter-user-interface-overview.aspx" target="_blank">How Disk Defragmenter in Windows 7 determines if a volume is on a SSD in order to exclude it from the schedule.</a></p>
<p><a href="http://www.winsupersite.com/win7/win7_skus_compare.asp" target="_blank">Comparison table</a> of which features are available in which version of Windows 7.</p>
<p>Beta version of <a href="http://blogs.technet.com/windowsserver/archive/2009/12/02/wingin-migration-now-migrate-even-more-server-roles-to-windows-server-2008-r2.aspx" target="_blank">Windows Server Migration Tools for Server 2008 R2</a>. Feedback welcome.</p>
<p>Here is a <a href="http://technet.microsoft.com/en-us/library/ee681713%28WS.10%29.aspx" target="_blank">list</a> of features that were removed in Win7/2008 R2 (e.g. NT4 domain join, Quick Launch Toolbar, &#8230;).</p>
<p>Looking for a list of all (44) features of Server 2008 R2? <a href="http://technet.microsoft.com/en-us/library/cc731400.aspx" target="_blank">Here</a> it is, well hidden in TechNet.</p>
<p>According to Microsoft&#8217;s Knowledge Base the only <a href="http://support.microsoft.com/kb/973289" target="_blank">supported way</a> of customizing the default user profile and creating a mandatory profile with Windows 7.</p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=2db685c7-bb06-4083-9978-66b57661f6f7" target="_blank">Changes in Functionality in Windows Server 2008 R2</a> &#8211; Microsoft white paper, 211 pages.</p>
<p>MS white paper: <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=e4d25d08-ae40-4c5c-ac81-eaacdc9923d3" target="_blank">Remote Desktop Protocol Performance Improvements in Windows Server 2008 R2 and Windows 7</a>.</p>
<h3>PowerShell</h3>
<p>PowerShell Configurator tool now in v1 RC: a more flexible <a href="http://www.codeplex.com/Wikipage?ProjectName=PSConfig" target="_blank">replacement for sconfig</a>.</p>
<p>PowerShell <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=df8ed469-9007-401c-85e7-46649a32d0e0" target="_blank">Quick Reference</a> (2 pages). Short, but nicely done.</p>
<h3>Citrix</h3>
<p>10 years of Citrix WebInterface, and it&#8217;s still not Web 2.0-ish or even user friendly. So Citrix <a href="http://community.citrix.com/display/ocb/2009/12/02/Web+Interface+-+A+Good+Time+to+Change" target="_blank">starts all over again.</a></p>
<p><a href="http://blogs.sepago.de/nicholas/2009/12/02/performance-monitoring-part-9-edgesight-vs-resource-manager-for-xenapp/" target="_blank">Detailed comparison</a> of the architectures of Citrix Resource Manager and EdgeSight.</p>
<p>Good news for all who are using Citrix PVS with app streaming: future versions <a href="http://community.citrix.com/display/ocb/2009/12/04/App+Streaming+-+CAB+to+DIR" target="_blank">reduce expensive disk writes</a>.</p>
<p>Citrix application streaming to support <a href="http://community.citrix.com/display/ocb/2009/12/15/App+Streaming+-+Isolation+of+Services" target="_blank">isolation/streaming of Windows services</a>.</p>
<p>Citrix User Profile Manager can now <a href="http://community.citrix.com/display/ocb/2009/12/15/User+Profile+Manager+-+Just+in+time+populate" target="_blank">stream profiles</a> (transfer files only when used). That should reduce logon times nicely.</p>
<p><a href="http://community.citrix.com/display/ocb/2010/01/15/Optimizing+Windows+7+for+FlexCast+Delivery" target="_blank">Optimizing Windows 7 for XenDesktop</a>. A very good and detailed article by Citrix.</p>
<p><strong>Note:</strong> This is mainly a condensed and beautified version of my twitter postings. You can get them unfiltered and without delay by <a href="http://twitter.com/HelgeKlein" target="_blank">following me</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/02/11/new-articles-tools-tips-and-tricks-windows-7-and-2008-r2-powershell-and-citrix/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Are Mandatory User Profiles Deleted at Logoff &#8211; or Cached?</title>
		<link>http://blogs.sepago.de/helge/2010/01/24/are-mandatory-user-profiles-deleted-at-logoff-or-cached/</link>
		<comments>http://blogs.sepago.de/helge/2010/01/24/are-mandatory-user-profiles-deleted-at-logoff-or-cached/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 01:26:03 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[User Profiles]]></category>
		<category><![CDATA[Mandatory Profile]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1360</guid>
		<description><![CDATA[A popular misconception about mandatory user profiles is that they are deleted at logoff. I freely admit that I thought so, too, until I made some tests that proved I was wrong.
Locally Cached Mandatory Profiles
First, if you want to read up on the subject, see my earlier article Mandatory Profiles – The Good, the Bad [...]]]></description>
			<content:encoded><![CDATA[<p>A popular misconception about mandatory user profiles is that they are deleted at logoff. I freely admit that I thought so, too, until I made some tests that proved I was wrong.<span id="more-1360"></span></p>
<h3>Locally Cached Mandatory Profiles</h3>
<p>First, if you want to read up on the subject, see my earlier article <a href="http://blogs.sepago.de/helge/2009/02/17/mandatory-profiles-the-good-the-bad-and-the-ugly/" target="_blank">Mandatory Profiles – The Good, the Bad and the Ugly</a>.</p>
<p>Now let us dig into the subject of this post.</p>
<p>Mandatory profiles are similar to roaming profiles in that a master copy lives on a file server that gets copied down to the local machine at logon. Thus a locally cached version of the mandatory profile is created that is used and changed during the user session. This local copy of the mandatory profile is created once for each user, just as with a roaming profile. And at logoff, it stays where it is, unchanged. <strong>Windows does not delete mandatory profiles at logoff.</strong> (There was a <a href="http://support.microsoft.com/kb/893243" target="_blank">bug in Windows XP that caused mandatory profiles to be deleted. It has been fixed in service pack 3.)</a></p>
<p>But wait, are mandatory profiles not reset at each logon? Yes they are. But that does not happen through deletion of the locally cached version during logoff, but by replacing the local copy with the network copy during logon. In other words, everything the user changed during his or her last session is lost &#8211; that is what mandatory profiles are all about.</p>
<p>So what is that local cache used for, if it is reset at logon? It has one use only: allow logons when the network is not available. Only in that case the state of an earlier session is available in a later session.</p>
<h3>How to Delete Mandatory Profiles</h3>
<p>You probably do not want cached profiles to litter your systems. The group policy setting &#8220;Delete cached copies of roaming profiles&#8221; affects not only roaming, but also mandatory profiles. The setting is located here: Computer Configuration -&gt; System -&gt; User Profiles. If enabled, Windows deletes cached copies of roaming and mandatory profiles at logoff.</p>
<p>Unfortunately this group policy setting does not seem to have any effect on Server 2008 SP1. I simply could not get that version to delete cached mandatory profiles at logoff although cached roaming profiles were deleted as expected. <strong>There might be a bug in Windows Server 2008 SP1 breaking the deletion of cached mandatory profiles.</strong> After updating the machine to SP2 the problem was gone. On all other versions of Windows I tested (see below) mandatory profiles were deleted correctly if &#8220;Delete cached copies of roaming profiles&#8221; was enabled.</p>
<h3>Applies to</h3>
<p>The information in this article applies to Windows in general. However, I have tested on these versions:</p>
<ul>
<li>
		XP (x86) SP3
	</li>
<li>
		Server 2003 x64 SP2
	</li>
<li>
		Server 2008 x64 SP1
	</li>
<li>
		Server 2008 x64 SP2
	</li>
<li>
		Windows 7 RTM
	</li>
<li>
		Server 2008 R2 RTM
	</li>
</ul>
<h3>Non-Paid Advertisement</h3>
<p>Looking for a job? We have offerings. Check out our <a href="http://www.sepago.de/d/karriere.html" target="_blank">career pages</a> and also <a href="http://blogs.sepago.de/claudia/" target="_blank">Claudia&#8217;s blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/01/24/are-mandatory-user-profiles-deleted-at-logoff-or-cached/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Syntax Highlighting PowerShell Code in HTML &#8211; With a PowerShell Script</title>
		<link>http://blogs.sepago.de/helge/2010/01/18/syntax-highlighting-powershell-code-in-html-with-a-powershell-script/</link>
		<comments>http://blogs.sepago.de/helge/2010/01/18/syntax-highlighting-powershell-code-in-html-with-a-powershell-script/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 17:41:57 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[Syntax Highlighting]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1347</guid>
		<description><![CDATA[When you are publishing PowerShell code on the web, you soon discover that it looks much nicer with syntax highlighting &#8211; as did I. There are several ways to add syntax highlighting to your blog or web site, most of which rely on external (Wordpress) plugins or JavaScript on the page. I do not like [...]]]></description>
			<content:encoded><![CDATA[<p>When you are publishing PowerShell code on the web, you soon discover that it looks much nicer with syntax highlighting &#8211; as did I. There are several ways to add syntax highlighting to your blog or web site, most of which rely on external (Wordpress) plugins or JavaScript on the page. I do not like that approach too much. I prefer to have the syntax highlighting embedded in the HTML code. That way I have full control over the appearance (and the highlighting also works in Google Reader). The logical solution is to use a script that embeds HTML coloring tags directly into the script.<span id="more-1347"></span></p>
<h3>Highlight-Syntax.ps1</h3>
<p>My script Highlight-Syntax.ps1 is a much stripped down and slightly changed version of Lee Holmes&#8217; <a href="http://www.leeholmes.com/blog/MorePowerShellSyntaxHighlighting.aspx" target="_blank">Set-ClipboardScript.ps1</a> &#8211; thank you for making it available, Lee!</p>
<p>You call Highlight-Syntax.ps1 with the name of a .PS1 script which it parses and then generates an HTML file with a colorized version of that script. If you input &#8220;Get-AppVPackageDependencies.ps1&#8243; you will get &#8220;Get-AppVPackageDependencies.ps1.html&#8221;. That is it. The code in the HTML file can then easily be pasted into your favorite blog editor.</p>
<p>Highlight-Syntax.ps1 does not create fully-featured HTML files with head and body tags. That is by design. It simply takes your code and adds color information to it.</p>
<h3>The Code &#8211; And a Sample</h3>
<p>Here is the script which doubles as a sample of what its output looks like.</p>
<div class="codesnip-container" >
<pre>
<span style='color:#006400'>#</span>
<span style='color:#006400'># Original Author: Lee Holmes, http://www.leeholmes.com/blog/MorePowerShellSyntaxHighlighting.aspx</span>
<span style='color:#006400'>#</span>
<span style='color:#006400'># Modified by: Helge Klein, http://blogs.sepago.de/helge/</span>
<span style='color:#006400'>#</span>

<span style='color:#006400'>#</span>
<span style='color:#006400'># Syntax highlights a PowerShell script.</span>
<span style='color:#006400'>#</span>
<span style='color:#006400'># Usage: Supply the script to syntax hightligh as first and only parameter</span>
<span style='color:#006400'>#</span>
<span style='color:#006400'># Output: Copy of original script with extension &quot;.html&quot;</span>
<span style='color:#006400'>#</span>
<span style='color:#006400'># Example: .\Highlight-Syntax.ps1 .\Get-AppVPackageDependencies.ps1</span>
<span style='color:#006400'>#</span>

<span style='color:#A9A9A9'>[</span><span style='color:#ADD8E6'>CmdletBinding</span><span style='color:#000000'>(</span><span style='color:#000000'>)</span><span style='color:#A9A9A9'>]</span>
<span style='color:#00008B'>param</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$path</span><span style='color:#000000'>)</span>

<span style='color:#FF4500'>$tokenColours</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>@{</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Attribute'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FFADD8E6'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Command'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF0000FF'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'CommandArgument'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF8A2BE2'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'CommandParameter'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000080'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Comment'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF006400'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'GroupEnd'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'GroupStart'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Keyword'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF00008B'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'LineContinuation'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'LoopLabel'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF00008B'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Member'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'NewLine'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Number'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF800080'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Operator'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FFA9A9A9'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Position'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'StatementSeparator'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'String'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF8B0000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Type'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF008080'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Unknown'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FF000000'</span>
<span style='color:#000000'>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style='color:#8B0000'>'Variable'</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#FFFF4500'</span>
<span style='color:#000000'>}</span>

<span style='color:#006400'># Generate an HTML span and append it to HTML string builder</span>
<span style='color:#FF4500'>$currentLine</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#800080'>1</span>
<span style='color:#00008B'>function</span><span style='color:#000000'>&nbsp;</span><span style='color:#8A2BE2'>Append-HtmlSpan</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$block</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$tokenColor</span><span style='color:#000000'>)</span>
<span style='color:#000000'>{</span>
<span style='color:#000000'>   </span><span style='color:#00008B'>if</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$tokenColor</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-eq</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'NewLine'</span><span style='color:#000000'>)</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-or</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$tokenColor</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-eq</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'LineContinuation'</span><span style='color:#000000'>)</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>{</span>
<span style='color:#000000'>      </span><span style='color:#00008B'>if</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$tokenColor</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-eq</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'LineContinuation'</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#000000'>{</span>
<span style='color:#000000'>         </span><span style='color:#FF4500'>$null</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$codeBuilder</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Append</span><span style='color:#000000'>(</span><span style='color:#8B0000'>'`'</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#000000'>}</span>

<span style='color:#000000'>      </span><span style='color:#FF4500'>$null</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$codeBuilder</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Append</span><span style='color:#000000'>(</span><span style='color:#8B0000'>&quot;&lt;br /&gt;`r`n&quot;</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>}</span>
<span style='color:#000000'>   </span><span style='color:#00008B'>else</span>
<span style='color:#000000'>   </span><span style='color:#000000'>{</span>
<span style='color:#000000'>      </span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#008080'>[System.Web.HttpUtility]</span><span style='color:#A9A9A9'>::</span><span style='color:#000000'>HtmlEncode</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$block</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#00008B'>if</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#A9A9A9'>-not</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$block</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Trim</span><span style='color:#000000'>(</span><span style='color:#000000'>)</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#000000'>{</span>
<span style='color:#000000'>         </span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$block</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Replace</span><span style='color:#000000'>(</span><span style='color:#8B0000'>' '</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'&amp;nbsp;'</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#000000'>}</span>

<span style='color:#000000'>      </span><span style='color:#FF4500'>$htmlColor</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$tokenColours</span><span style='color:#A9A9A9'>[</span><span style='color:#FF4500'>$tokenColor</span><span style='color:#A9A9A9'>]</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>ToString</span><span style='color:#000000'>(</span><span style='color:#000000'>)</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Replace</span><span style='color:#000000'>(</span><span style='color:#8B0000'>'#FF'</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'#'</span><span style='color:#000000'>)</span>

<span style='color:#000000'>      </span><span style='color:#00008B'>if</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$tokenColor</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-eq</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'String'</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#000000'>{</span>
<span style='color:#000000'>         </span><span style='color:#FF4500'>$lines</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-split</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;`r`n&quot;</span>
<span style='color:#000000'>         </span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;&quot;</span>

<span style='color:#000000'>         </span><span style='color:#FF4500'>$multipleLines</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$false</span>
<span style='color:#000000'>         </span><span style='color:#00008B'>foreach</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$line</span><span style='color:#000000'>&nbsp;</span><span style='color:#00008B'>in</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$lines</span><span style='color:#000000'>)</span>
<span style='color:#000000'>         </span><span style='color:#000000'>{</span>
<span style='color:#000000'>            </span><span style='color:#00008B'>if</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$multipleLines</span><span style='color:#000000'>)</span>
<span style='color:#000000'>            </span><span style='color:#000000'>{</span>
<span style='color:#000000'>               </span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>+=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;&lt;BR /&gt;`r`n&quot;</span>
<span style='color:#000000'>            </span><span style='color:#000000'>}</span>

<span style='color:#000000'>            </span><span style='color:#FF4500'>$newText</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$line</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>TrimStart</span><span style='color:#000000'>(</span><span style='color:#000000'>)</span>
<span style='color:#000000'>            </span><span style='color:#FF4500'>$newText</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;&amp;nbsp;&quot;</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>*</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$line</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Length</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$newText</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Length</span><span style='color:#000000'>)</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>+</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$newText</span>
<span style='color:#000000'>            </span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>+=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$newText</span>
<span style='color:#000000'>            </span><span style='color:#FF4500'>$multipleLines</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$true</span>
<span style='color:#000000'>         </span><span style='color:#000000'>}</span>
<span style='color:#000000'>      </span><span style='color:#000000'>}</span>

<span style='color:#000000'>      </span><span style='color:#FF4500'>$null</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$codeBuilder</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Append</span><span style='color:#000000'>(</span><span style='color:#8B0000'>&quot;&lt;span style='color:$htmlColor'&gt;$block&lt;/span&gt;&quot;</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>}</span>
<span style='color:#000000'>}</span>

<span style='color:#00008B'>function</span><span style='color:#000000'>&nbsp;</span><span style='color:#8A2BE2'>Main</span>
<span style='color:#000000'>{</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$text</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$null</span>

<span style='color:#000000'>   </span><span style='color:#00008B'>if</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$path</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>{</span>
<span style='color:#000000'>      </span><span style='color:#FF4500'>$text</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#0000FF'>Get-Content</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$path</span><span style='color:#000000'>)</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-join</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;`r`n&quot;</span>
<span style='color:#000000'>   </span><span style='color:#000000'>}</span>
<span style='color:#000000'>   </span><span style='color:#00008B'>else</span>
<span style='color:#000000'>   </span><span style='color:#000000'>{</span>
<span style='color:#000000'>      </span><span style='color:#0000FF'>Write-Error</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'Please supply the path to the PowerShell script to syntax highlight as first (and only) parameter.'</span>
<span style='color:#000000'>      </span><span style='color:#00008B'>return</span>
<span style='color:#000000'>   </span><span style='color:#000000'>}</span>

<span style='color:#000000'>   </span><span style='color:#00008B'>trap</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>{</span><span style='color:#000000'>&nbsp;</span><span style='color:#00008B'>break</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>}</span>

<span style='color:#000000'>   </span><span style='color:#006400'># Do syntax parsing.</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$errors</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$null</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$tokens</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#008080'>[system.management.automation.psparser]</span><span style='color:#A9A9A9'>::</span><span style='color:#000000'>Tokenize</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$Text</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>&nbsp;</span><span style='color:#008080'>[ref]</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$errors</span><span style='color:#000000'>)</span>

<span style='color:#000000'>   </span><span style='color:#006400'># Initialize HTML builder.</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$codeBuilder</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#0000FF'>new-object</span><span style='color:#000000'>&nbsp;</span><span style='color:#8A2BE2'>system.text.stringbuilder</span>

<span style='color:#000000'>   </span><span style='color:#006400'># Iterate over the tokens and set the colors appropriately.</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$position</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#800080'>0</span>
<span style='color:#000000'>   </span><span style='color:#00008B'>foreach</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$token</span><span style='color:#000000'>&nbsp;</span><span style='color:#00008B'>in</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$tokens</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>{</span>
<span style='color:#000000'>      </span><span style='color:#00008B'>if</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$position</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-lt</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$token</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Start</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#000000'>{</span>
<span style='color:#000000'>         </span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$text</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Substring</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$position</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$token</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Start</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$position</span><span style='color:#000000'>)</span><span style='color:#000000'>)</span>
<span style='color:#000000'>         </span><span style='color:#FF4500'>$tokenColor</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>'Unknown'</span>
<span style='color:#000000'>         </span><span style='color:#0000FF'>Append-HtmlSpan</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$tokenColor</span>
<span style='color:#000000'>      </span><span style='color:#000000'>}</span>

<span style='color:#000000'>      </span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$text</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Substring</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$token</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Start</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$token</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Length</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#FF4500'>$tokenColor</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$token</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Type</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>ToString</span><span style='color:#000000'>(</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#0000FF'>Append-HtmlSpan</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$block</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$tokenColor</span>

<span style='color:#000000'>      </span><span style='color:#FF4500'>$position</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$token</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Start</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>+</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$token</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Length</span>
<span style='color:#000000'>   </span><span style='color:#000000'>}</span>

<span style='color:#000000'>   </span><span style='color:#006400'># Build the entire syntax-highlighted script</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$code</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$codeBuilder</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>ToString</span><span style='color:#000000'>(</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span>
<span style='color:#000000'>   </span><span style='color:#006400'># Replace tabs with three blanks</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$code</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$code</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-replace</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;\t&quot;</span><span style='color:#A9A9A9'>,</span><span style='color:#8B0000'>&quot;   &quot;</span>

<span style='color:#000000'>   </span><span style='color:#006400'># Write the HTML to a file</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$code</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>|</span><span style='color:#000000'>&nbsp;</span><span style='color:#0000FF'>set-content</span><span style='color:#000000'>&nbsp;</span><span style='color:#000080'>-path</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;$path.html&quot;</span>
<span style='color:#000000'>}</span>

<span style='color:#A9A9A9'>.</span><span style='color:#000000'>&nbsp;</span><span style='color:#0000FF'>Main</span>
</pre>
</div>
<h3>Download</h3>
<p>You can download a digitally signed version of the script <a href='http://blogs.sepago.de/helge/files/2010/01/Highlight-Syntax.zip'>here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/01/18/syntax-highlighting-powershell-code-in-html-with-a-powershell-script/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to List All Installed Applications From the Command Line</title>
		<link>http://blogs.sepago.de/helge/2010/01/14/how-to-list-all-installed-applications-from-the-command-line/</link>
		<comments>http://blogs.sepago.de/helge/2010/01/14/how-to-list-all-installed-applications-from-the-command-line/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 20:27:28 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[Applications]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[WMI]]></category>
		<category><![CDATA[WMIC]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1321</guid>
		<description><![CDATA[How to easily create a list of all programs and (MSI) packages installed on a system for later processing? That sounds like a simple task, and it is. Interestingly, a quick web search revealed primarily more complex solutions where a script is used to iterate through the uninstall information in the registry. That not only [...]]]></description>
			<content:encoded><![CDATA[<p>How to easily create a list of all programs and (MSI) packages installed on a system for later processing? That sounds like a simple task, and it is. Interestingly, a quick web search revealed primarily more complex solutions where a script is used to iterate through the uninstall information in the registry. That not only is far too complicated, but also inaccurate.<span id="more-1321"></span></p>
<h3>Putting WMIC to Work</h3>
<p>As often, the local WMI database contains all the information we need. The simplest way of extracting the required data is via the WMI command line, wmic:</p>
<div class="codesnip-container" >wmic product</div>
<p>Yes, that is all. It runs for a while and then spits out very detailed information on what is installed on the local system. If you need the information in a file for later processing, use the following variation of above command to have wmic create a CSV file:</p>
<div class="codesnip-container" >wmic product get /format:csv &gt; Software_%Computername%.csv</div>
<p>The result is a nice complete list in CSV format in a file that already contains the computer name for easier processing later on. Here is some sample output from my machine:</p>
<div class="codesnip-container" >
<pre>
Node,AssignmentType,Caption,Description,HelpLink,HelpTelephone,IdentifyingNumber,InstallDate,InstallDate2,InstallLocation,InstallSource,InstallState,Language,LocalPackage,Name,PackageCache,PackageCode,PackageName,ProductID,RegCompany,RegOwner,SKUNumber,Transforms,URLInfoAbout,URLUpdateInfo,Vendor,Version,WordCount
NB-HKLEIN,1,Microsoft Office Visual Web Developer 2007,Microsoft Office Visual Web Developer 2007,,,{90120000-0021-0000-0000-0000000FF1CE},20091110,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0021-0000-0000-0000000FF1CE}-C\,5,0,C:\Windows\Installer\47a476.msi,Microsoft Office Visual Web Developer 2007,C:\Windows\Installer\47a476.msi,{8F0496DA-7F60-40C3-871B-DA76B0DABD0C},VisualWebDeveloperWW.msi,82503-694-0000007-62461,sepago GmbH,Helge Klein,,C:\Windows\Installer\{90120000-0021-0000-0000-0000000FF1CE}\ShellUI.MST,,,Microsoft Corporation,12.0.4518.1066,2
NB-HKLEIN,1,Microsoft Office Visual Web Developer MUI (English) 2007,Microsoft Office Visual Web Developer MUI (English) 2007,,,{90120000-0021-0409-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0021-0409-0000-0000000FF1CE}-C\,5,1033,C:\Windows\Installer\47a46c.msi,Microsoft Office Visual Web Developer MUI (English) 2007,C:\Windows\Installer\47a46c.msi,{1B68F013-A620-44FC-BC81-4F7A8B8375A0},VisualWebDeveloperMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Visio Professional 2007,Microsoft Office Visio Professional 2007,,,{90120000-0051-0000-0000-0000000FF1CE},20091014,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0051-0000-0000-0000000FF1CE}-C\,5,0,C:\Windows\Installer\2b3646.msi,Microsoft Office Visio Professional 2007,C:\Windows\Installer\2b3646.msi,{821068B0-013F-40CE-A1D0-37B087A8FF2F},VisProWW.msi,89405-861-5535692-63715,sepago GmbH,Helge Klein,,C:\Windows\Installer\{90120000-0051-0000-0000-0000000FF1CE}\ShellUI.MST,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office OneNote MUI (German) 2007,Microsoft Office OneNote MUI (German) 2007,,,{90120000-00A1-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-00A1-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b35dd.msi,Microsoft Office OneNote MUI (German) 2007,C:\Windows\Installer\2b35dd.msi,{41063EDF-1369-4DD6-AE98-7878A8021E0B},OneNoteMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office InfoPath MUI (German) 2007,Microsoft Office InfoPath MUI (German) 2007,,,{90120000-0044-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0044-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b3588.msi,Microsoft Office InfoPath MUI (German) 2007,C:\Windows\Installer\2b3588.msi,{BD4F14DE-A9E4-4B93-887F-790DC2ADB443},InfoPathMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Visio MUI (German) 2007,Microsoft Office Visio MUI (German) 2007,,,{90120000-0054-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0054-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b3625.msi,Microsoft Office Visio MUI (German) 2007,C:\Windows\Installer\2b3625.msi,{079E3665-529F-4D94-AAF0-E057A1C63343},VisioMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Access MUI (German) 2007,Microsoft Office Access MUI (German) 2007,,,{90120000-0015-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0015-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b35d5.msi,Microsoft Office Access MUI (German) 2007,C:\Windows\Installer\2b35d5.msi,{5BCE6E56-AE94-4509-8D68-47F2AE3E87E1},AccessMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Shared Setup Metadata MUI (English) 2007,Microsoft Office Shared Setup Metadata MUI (English) 2007,,,{90120000-0115-0409-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0115-0409-0000-0000000FF1CE}-C\,5,1033,C:\Windows\Installer\47a464.msi,Microsoft Office Shared Setup Metadata MUI (English) 2007,C:\Windows\Installer\47a464.msi,{B098E01B-7F1F-48DC-8A6D-2243E942FD6F},OfficeMUISet.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Excel MUI (German) 2007,Microsoft Office Excel MUI (German) 2007,,,{90120000-0016-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0016-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b3566.msi,Microsoft Office Excel MUI (German) 2007,C:\Windows\Installer\2b3566.msi,{194C8759-3D69-46DD-B05C-4CB4A1FA6000},ExcelMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office PowerPoint MUI (German) 2007,Microsoft Office PowerPoint MUI (German) 2007,,,{90120000-0018-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0018-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b3578.msi,Microsoft Office PowerPoint MUI (German) 2007,C:\Windows\Installer\2b3578.msi,{7449EBEE-BAD7-4D44-96C6-F23996C7B613},PowerPointMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Publisher MUI (German) 2007,Microsoft Office Publisher MUI (German) 2007,,,{90120000-0019-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0019-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b35c3.msi,Microsoft Office Publisher MUI (German) 2007,C:\Windows\Installer\2b35c3.msi,{2439A177-3D7B-415E-8B2D-6885571CA072},PublisherMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Outlook MUI (German) 2007,Microsoft Office Outlook MUI (German) 2007,,,{90120000-001A-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-001A-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b356f.msi,Microsoft Office Outlook MUI (German) 2007,C:\Windows\Installer\2b356f.msi,{20612ECC-02E8-42B6-89A7-0C52005ED9DB},OutlookMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Office 64-bit Components 2007,Microsoft Office Office 64-bit Components 2007,,,{90120000-002A-0000-1000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{91120000-002E-0000-0000-0000000FF1CE}-C\,5,0,C:\Windows\Installer\2b35e6.msi,Microsoft Office Office 64-bit Components 2007,C:\Windows\Installer\2b35e6.msi,{BB540498-3B22-45D7-8E2F-F80F8C08354E},Office64WW.msi,,,,,C:\Windows\Installer\{90120000-002A-0000-1000-0000000FF1CE}\ShellUI.MST,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Shared 64-bit MUI (German) 2007,Microsoft Office Shared 64-bit MUI (German) 2007,,,{90120000-002A-0407-1000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-002A-0407-1000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b3590.msi,Microsoft Office Shared 64-bit MUI (German) 2007,C:\Windows\Installer\2b3590.msi,{BF63F822-3F4B-4B71-8F56-371FEF051B70},Office64MUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Groove MUI (German) 2007,Microsoft Office Groove MUI (German) 2007,,,{90120000-00BA-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-00BA-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b3580.msi,Microsoft Office Groove MUI (German) 2007,C:\Windows\Installer\2b3580.msi,{9062E123-7F0D-48E7-A4EB-07FA087EC55D},GrooveMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Word MUI (German) 2007,Microsoft Office Word MUI (German) 2007,,,{90120000-001B-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-001B-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b35cc.msi,Microsoft Office Word MUI (German) 2007,C:\Windows\Installer\2b35cc.msi,{D0FEB987-B949-4FBB-9443-8EF5E4C63B24},WordMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Proofing (German) 2007,Microsoft Office Proofing (German) 2007,,,{90120000-002C-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-002C-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b35bb.msi,Microsoft Office Proofing (German) 2007,C:\Windows\Installer\2b35bb.msi,{9DF79774-8369-46FD-AB0F-29C4BE379FB7},Proofing.msi,,,,,,,,Microsoft Corporation,12.0.4518.1014,2
NB-HKLEIN,1,Microsoft Office Shared MUI (German) 2007,Microsoft Office Shared MUI (German) 2007,,,{90120000-006E-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-006E-0407-0000-0000000FF1CE}-C\,5,1031,C:\Windows\Installer\2b355e.msi,Microsoft Office Shared MUI (German) 2007,C:\Windows\Installer\2b355e.msi,{1DE51602-63F6-4ACA-AF7E-787D1DA2C87B},OfficeMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Shared MUI (English) 2007,Microsoft Office Shared MUI (English) 2007,,,{90120000-006E-0409-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-0115-0409-0000-0000000FF1CE}-C\,5,1033,C:\Windows\Installer\47a45c.msi,Microsoft Office Shared MUI (English) 2007,C:\Windows\Installer\47a45c.msi,{3A4478D0-B2FD-4A3C-8C5F-889692F35C99},OfficeMUI.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Proof (Italian) 2007,Microsoft Office Proof (Italian) 2007,,,{90120000-001F-0410-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-002C-0407-0000-0000000FF1CE}-C\Proof.it\,5,1040,C:\Windows\Installer\2b3598.msi,Microsoft Office Proof (Italian) 2007,C:\Windows\Installer\2b3598.msi,{27C30CC2-60AB-4AF3-BEF6-FBCD8EA92802},Proof.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Proof (German) 2007,Microsoft Office Proof (German) 2007,,,{90120000-001F-0407-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-002C-0407-0000-0000000FF1CE}-C\Proof.de\,5,1031,C:\Windows\Installer\2b35a1.msi,Microsoft Office Proof (German) 2007,C:\Windows\Installer\2b35a1.msi,{4C5774D8-1C30-42A7-AA9C-E8C9F1A22970},Proof.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Proof (English) 2007,Microsoft Office Proof (English) 2007,,,{90120000-001F-0409-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-002C-0407-0000-0000000FF1CE}-C\Proof.en\,5,1033,C:\Windows\Installer\2b35b3.msi,Microsoft Office Proof (English) 2007,C:\Windows\Installer\2b35b3.msi,{FCE6A278-C1AE-431F-BBCA-EA6CF34C0BCF},Proof.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Proof (French) 2007,Microsoft Office Proof (French) 2007,,,{90120000-001F-040C-0000-0000000FF1CE},20090901,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{90120000-002C-0407-0000-0000000FF1CE}-C\Proof.fr\,5,1036,C:\Windows\Installer\2b35aa.msi,Microsoft Office Proof (French) 2007,C:\Windows\Installer\2b35aa.msi,{A57F3989-21C1-4267-9019-088688971275},Proof.msi,,,,,,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Office Ultimate 2007,Microsoft Office Ultimate 2007,,,{91120000-002E-0000-0000-0000000FF1CE},20100113,,C:\Program Files (x86)\Microsoft Office\,C:\MSOCache\All Users\{91120000-002E-0000-0000-0000000FF1CE}-C\,5,0,C:\Windows\Installer\2b35f1.msi,Microsoft Office Ultimate 2007,C:\Windows\Installer\2b35f1.msi,{C633FD41-60F4-4BF5-B60F-D5B473AE9127},UltimaterWW.msi,81608-861-1008552-65194,sepago GmbH,Helge Klein,,C:\Windows\Installer\{91120000-002E-0000-0000-0000000FF1CE}\ShellUI.MST,,,Microsoft Corporation,12.0.6425.1000,2
NB-HKLEIN,1,Microsoft Application Error Reporting,Microsoft Application Error Reporting,http://support.microsoft.com,,{95120000-00B9-0409-1000-0000000FF1CE},20091026,,,F:\1a7cba7f5674b7973ea697\PreReq\Watson\amd64\,5,1033,C:\Windows\Installer\50aef01.msi,Microsoft Application Error Reporting,C:\Windows\Installer\50aef01.msi,{F47058A9-F4BF-420D-B567-104C552A3F63},dw20sharedamd64.msi,,,,,,http://support.microsoft.com,,Microsoft Corporation,12.0.6015.5000,2
NB-HKLEIN,1,Microsoft Windows SDK for Visual Studio 2008 SP1 Tools,Microsoft Windows SDK for Visual Studio 2008 SP1 Tools,http://go.microsoft.com/fwlink/?linkid=55774,,{62EED300-E841-4083-A1D6-60B906271804},20090902,,,C:\Users\hklein\AppData\Local\Temp\IXP05D7A.tmp\wcu\winsdk\,5,1033,C:\Windows\Installer\47a506.msi,Microsoft Windows SDK for Visual Studio 2008 SP1 Tools,C:\Windows\Installer\47a506.msi,{EF4F5D7E-FD77-4634-B9A9-C05AD3C5C46F},VistaClientSDKTools-x64.msi,12345-111-1111111-99479,,hklein,,,,http://go.microsoft.com/fwlink/?linkid=55774,Microsoft Corporation,6.1.5294.17011,0
NB-HKLEIN,1,Microsoft Network Monitor 3.3,Microsoft Network Monitor 3.3,,,{365C5A10-6561-454F-B975-56EA878D0A06},20091216,,,C:\Users\HKLEIN~1.SEP\AppData\Local\Temp\IXP000.TMP\,5,1033,C:\Windows\Installer\162356b.msi,Microsoft Network Monitor 3.3,C:\Windows\Installer\162356b.msi,{315EB3CE-C69D-4965-92DB-4B6333C37DD2},netmon.msi,none,,hklein,,,,,Microsoft Corporation,3.3.1641.0,2
NB-HKLEIN,1,Microsoft Visual Studio Team System 2008 Development Edition - ENU,Microsoft Visual Studio Team System 2008 Development Edition - ENU,,,{6721AC10-3743-38F1-B178-C0EC6C9A4108},20091014,,,h:\,5,1033,C:\Windows\Installer\47a4a1.msi,Microsoft Visual Studio Team System 2008 Development Edition - ENU,C:\Windows\Installer\47a4a1.msi,{E5CAF2F5-394A-4BAC-857E-1846B024872B},vs_setup.msi,91904-270-8202896-60643,Microsoft,Microsoft,,,,,Microsoft Corporation,9.0.30729,0
NB-HKLEIN,1,ActivePerl 5.10.1 Build 1006,ActivePerl 5.10.1 Build 1006,http://www.activestate.com/Support/index.html,,{E7DF4F40-A0CE-430E-8B3B-DB7C8DF1C1A2},20090916,,C:\Program Files (x86)\Perl\,D:\temp\,5,1033,C:\Windows\Installer\2746354.msi,ActivePerl 5.10.1 Build 1006,C:\Windows\Installer\2746354.msi,{1FF10207-45B8-44CC-81B0-ECA3FD866665},ActivePerl-5.10.1.1006-MSWin32-x86-291086.msi,none,,hklein,,,http://www.activestate.com/,http://www.activestate.com/ASPN/Downloads/ActivePerl,ActiveState,5.10.1006,2
[...]
</pre>
</div>
<h3>References</h3>
<p><a href="http://support.microsoft.com/servicedesks/webcasts/wc072402/listofsampleusage.asp" target="_blank">Examples that show how to use WMIC commands from Microsoft</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/01/14/how-to-list-all-installed-applications-from-the-command-line/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>PowerShell Script Lists App-V Package Dependencies (Dynamic Suite Composition, DSC)</title>
		<link>http://blogs.sepago.de/helge/2010/01/06/powershell-script-lists-app-v-package-dependencies-dynamic-suite-composition-dsc/</link>
		<comments>http://blogs.sepago.de/helge/2010/01/06/powershell-script-lists-app-v-package-dependencies-dynamic-suite-composition-dsc/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 22:01:36 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[Scripting]]></category>
		<category><![CDATA[App-V]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Script]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1309</guid>
		<description><![CDATA[App-V&#8217;s Dynamic Suite Composition is a powerful feature in that it allows multiple &#8220;bubbles&#8221; to share the same virtual environment. In other words, package A can be made dependent on package B. But if DSC is used extensively, dependencies between packages tend to become difficult to manage &#8211; there seems to be no simple way [...]]]></description>
			<content:encoded><![CDATA[<p>App-V&#8217;s Dynamic Suite Composition is a powerful feature in that it allows multiple &#8220;bubbles&#8221; to share the same virtual environment. In other words, package A can be made dependent on package B. But if DSC is used extensively, dependencies between packages tend to become difficult to manage &#8211; there seems to be no simple way of listing all packages&#8217; dependencies. Well, I have written a PowerShell script that does just that.<span id="more-1309"></span></p>
<h3>Using Get-AppVPackageDependencies</h3>
<p>Just call the script with the path (UNC or local) to a folder containing packages. The script will recursively search the path given for OSD files and analyze each OSD file for dependencies. Here is some sample output:</p>
<div class="codesnip-container" >
<pre>
PS D:\&gt; .\Get-AppVPackageDependencies.ps1 .\

============================================================
Dependencies found:
============================================================

DaveSoft_CopyRite_Vista.CopyRite -&gt; Nvu
Opera -&gt; Firefox_JRE

============================================================
All packages found:
============================================================

Name                             GUID
----                             ----
Nvu                              3AAC7EE6-84C4-4021-966B-56C52FF95AAF
WinDirStat                       3C5E1C59-D56E-4463-B9A0-5190034E6223
DaveSoft_CopyRite_Vista.CopyRite 4A7697E4-ED02-4D87-A8F0-88D7DEB914DE
Firefox_JRE                      999E8458-D477-4975-B3C8-3BCE1252B991
Opera                            24D14B13-1838-45B2-9DAC-78D0A7432F69
</pre>
</div>
<p>In the example above, the script was located in the same folder as the packages, thus the parameter &#8220;.\&#8221;.</p>
<h3>Get-AppVPackageDependencies &#8211; the Script</h3>
<p>Here is the source code. Let me know if it is useful to you.</p>
<div class="codesnip-container" >
<pre>
<span style='color:#006400'>#</span>
<span style='color:#006400'>#   Get-AppVPackageDependencies by Helge Klein, sepago GmbH, http://blogs.sepago.de/helge/</span>
<span style='color:#006400'>#</span>
<span style='color:#006400'>#   Usage:</span>
<span style='color:#006400'>#</span>
<span style='color:#006400'>#   Get-AppVPackageDependencies &lt;path to folder containing packages&gt;</span>
<span style='color:#006400'>#</span>

<span style='color:#006400'>#Requires -Version 2</span>

<span style='color:#00008B'>param</span><span style='color:#000000'>(</span>
<span style='color:#000000'>   </span><span style='color:#A9A9A9'>[</span><span style='color:#ADD8E6'>ValidateNotNullOrEmpty</span><span style='color:#000000'>(</span><span style='color:#000000'>)</span><span style='color:#A9A9A9'>]</span><span style='color:#000000'>&nbsp;</span>
<span style='color:#000000'>   </span><span style='color:#008080'>[System.String[]]</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$PackageBasePath</span>
<span style='color:#000000'>)</span>

<span style='color:#006400'># Initialize a hash table that stores GUID -&gt; name associations</span>
<span style='color:#FF4500'>$Packages</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>@{</span><span style='color:#000000'>}</span>

<span style='color:#006400'># Get a list of all .OSD files below the base path passed in</span>
<span style='color:#FF4500'>$SFTFiles</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#0000FF'>Get-ChildItem</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$PackageBasePath</span><span style='color:#000000'>&nbsp;</span><span style='color:#000080'>-filter</span><span style='color:#000000'>&nbsp;</span><span style='color:#8A2BE2'>*.osd</span><span style='color:#000000'>&nbsp;</span><span style='color:#000080'>-force</span><span style='color:#000000'>&nbsp;</span><span style='color:#000080'>-recurse</span>

<span style='color:#006400'># Store each OSD file's data (name and GUID)</span>
<span style='color:#00008B'>foreach</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$SFTFile</span><span style='color:#000000'>&nbsp;</span><span style='color:#00008B'>in</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFiles</span><span style='color:#000000'>)</span>
<span style='color:#000000'>{</span>
<span style='color:#000000'>   </span><span style='color:#006400'># Read the OSD file</span>
<span style='color:#000000'>   </span><span style='color:#008080'>[xml]</span><span style='color:#000000'>   </span><span style='color:#FF4500'>$SFTFileXML</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#0000FF'>Get-Content</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFile</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>FullName</span>
<span style='color:#000000'>   </span>
<span style='color:#000000'>   </span><span style='color:#006400'># Store relevant information</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$PkgName</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFileXML</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>SOFTPKG</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>NAME</span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$PkgGUID</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFileXML</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>SOFTPKG</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>IMPLEMENTATION</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>CODEBASE</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>GUID</span>

<span style='color:#000000'>   </span><span style='color:#00008B'>if</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$Packages</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>ContainsKey</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$PkgGUID</span><span style='color:#000000'>)</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-eq</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$false</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>{</span>
<span style='color:#000000'>      </span><span style='color:#FF4500'>$Packages</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Add</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$PkgGUID</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$PkgName</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>}</span>
<span style='color:#000000'>}</span>

<span style='color:#0000FF'>Write-Output</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;`n============================================================`nDependencies found:`n============================================================`n&quot;</span>

<span style='color:#006400'># Process each package's dependencies</span>
<span style='color:#00008B'>foreach</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$SFTFile</span><span style='color:#000000'>&nbsp;</span><span style='color:#00008B'>in</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFiles</span><span style='color:#000000'>)</span>
<span style='color:#000000'>{</span>
<span style='color:#000000'>   </span><span style='color:#006400'># Read the OSD file</span>
<span style='color:#000000'>   </span><span style='color:#008080'>[xml]</span><span style='color:#000000'>   </span><span style='color:#FF4500'>$SFTFileXML</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#0000FF'>Get-Content</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFile</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>FullName</span>
<span style='color:#000000'>   </span>
<span style='color:#000000'>   </span><span style='color:#FF4500'>$PkgDependencies</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFileXML</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>SOFTPKG</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>IMPLEMENTATION</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>VIRTUALENV</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>DEPENDENCIES</span>
<span style='color:#000000'>   </span>
<span style='color:#000000'>   </span><span style='color:#00008B'>foreach</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$PkgDependency</span><span style='color:#000000'>&nbsp;</span><span style='color:#00008B'>in</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$PkgDependencies</span><span style='color:#000000'>)</span>
<span style='color:#000000'>   </span><span style='color:#000000'>{</span>
<span style='color:#000000'>      </span><span style='color:#006400'># Extract package information (again)</span>
<span style='color:#000000'>      </span><span style='color:#FF4500'>$PkgName</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFileXML</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>SOFTPKG</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>NAME</span>
<span style='color:#000000'>      </span><span style='color:#FF4500'>$PkgGUID</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$SFTFileXML</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>SOFTPKG</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>IMPLEMENTATION</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>CODEBASE</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>GUID</span>
<span style='color:#000000'>      </span>
<span style='color:#000000'>      </span><span style='color:#006400'># Extract the GUID the package depends on</span>
<span style='color:#000000'>      </span><span style='color:#FF4500'>$PkgDependencyGUID</span><span style='color:#000000'>   </span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$PkgDependency</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>CODEBASE</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>GUID</span>
<span style='color:#000000'>      </span>
<span style='color:#000000'>      </span><span style='color:#006400'># Look up the depending package's name</span>
<span style='color:#000000'>      </span><span style='color:#00008B'>if</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$PkgDependencyGUID</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-ne</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$null</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>-and</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$Packages</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>ContainsKey</span><span style='color:#000000'>(</span><span style='color:#FF4500'>$PkgDependencyGUID</span><span style='color:#000000'>)</span><span style='color:#000000'>)</span>
<span style='color:#000000'>      </span><span style='color:#000000'>{</span>
<span style='color:#000000'>         </span><span style='color:#0000FF'>Write-Output</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;$PkgName -&gt; $($Packages.Get_Item($PkgDependencyGUID))&quot;</span>
<span style='color:#000000'>      </span><span style='color:#000000'>}</span>
<span style='color:#000000'>   </span><span style='color:#000000'>}</span>
<span style='color:#000000'>}</span>

<span style='color:#0000FF'>Write-Output</span><span style='color:#000000'>&nbsp;</span><span style='color:#8B0000'>&quot;`n============================================================`nAll packages found:`n============================================================&quot;</span>
<span style='color:#0000FF'>Write-Output</span><span style='color:#000000'>&nbsp;</span><span style='color:#FF4500'>$Packages</span><span style='color:#000000'>&nbsp;</span><span style='color:#A9A9A9'>|</span><span style='color:#000000'>&nbsp;</span><span style='color:#0000FF'>format-table</span><span style='color:#000000'>&nbsp;</span><span style='color:#000080'>-auto</span><span style='color:#000000'>&nbsp;</span><span style='color:#000000'>@{</span><span style='color:#000000'>Label</span><span style='color:#A9A9A9'>=</span><span style='color:#8B0000'>&quot;Name&quot;</span><span style='color:#000000'>;</span><span style='color:#000000'>Expression</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>{</span><span style='color:#FF4500'>$_</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Value</span><span style='color:#000000'>}</span><span style='color:#000000'>}</span><span style='color:#A9A9A9'>,</span><span style='color:#000000'>@{</span><span style='color:#000000'>Label</span><span style='color:#A9A9A9'>=</span><span style='color:#8B0000'>&quot;GUID&quot;</span><span style='color:#000000'>;</span><span style='color:#000000'>Expression</span><span style='color:#A9A9A9'>=</span><span style='color:#000000'>{</span><span style='color:#FF4500'>$_</span><span style='color:#A9A9A9'>.</span><span style='color:#000000'>Name</span><span style='color:#000000'>}</span><span style='color:#000000'>}</span>
</pre>
</div>
<h3>Download</h3>
<p>You can also download a digitally signed version of the script <a href="http://blogs.sepago.de/helge/files/2010/01/Get-AppVPackageDependencies.zip">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/01/06/powershell-script-lists-app-v-package-dependencies-dynamic-suite-composition-dsc/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to Analyze Kernel Performance Bottlenecks (and Find that ATI&#8217;s Catalyst Drivers Cause 50% CPU Utilization)</title>
		<link>http://blogs.sepago.de/helge/2010/01/04/how-to-analyze-kernel-performance-bottlenecks-and-find-that-atis-catalyst-drivers-cause-50-cpu-utilization/</link>
		<comments>http://blogs.sepago.de/helge/2010/01/04/how-to-analyze-kernel-performance-bottlenecks-and-find-that-atis-catalyst-drivers-cause-50-cpu-utilization/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 17:10:15 +0000</pubDate>
		<dc:creator>Helge Klein</dc:creator>
				<category><![CDATA[Performance / Sizing]]></category>
		<category><![CDATA[ATI]]></category>
		<category><![CDATA[CPU]]></category>
		<category><![CDATA[Drivers]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Performance]]></category>

		<guid isPermaLink="false">https://blogs.sepago.de/helge/?p=1299</guid>
		<description><![CDATA[Normally, finding the cause for high CPU utilization is easy &#8211; just start Task Manager. But what if the component consuming CPU cycles is a driver that runs in the kernel? In that case, there is no regular process Task Manager could attribute the usage to. You will see the &#8220;System Idle Process&#8221; at around [...]]]></description>
			<content:encoded><![CDATA[<p>Normally, finding the cause for high CPU utilization is easy &#8211; just start Task Manager. But what if the component consuming CPU cycles is a driver that runs in the kernel? In that case, there is no regular process Task Manager could attribute the usage to. You will see the &#8220;System Idle Process&#8221; at around 98%, but the &#8220;Performance&#8221; tab might indicate 50% CPU usage. How can that be?<span id="more-1299"></span></p>
<h3>Problem</h3>
<p>I recently had this exact scenario when I installed a new graphics card in a private PC. Here is how it looked in Task Manager:</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/01/Task-Manager-1.gif" rel="lightbox[id1299]"><img src="http://blogs.sepago.de/helge/files/2010/01/Task-Manager-1.gif" alt="Task Manager 1" width="511" height="802" class="alignnone size-full wp-image-1301" /></a></p>
<h3>Analysis</h3>
<p>It looks like some kernel-mode component eats up CPU cycles. But which one? The tool of choice here is Microsoft&#8217;s <a href="http://www.microsoft.com/downloads/details.aspx?familyid=d6e95259-8d9d-4c22-89c4-fad382eddcd1&amp;displaylang=en" target="_blank">Kernrate Viewer</a>. It collects kernel-mode CPU performance data and later displays a summary of the most active modules (drivers). This is what I got:</p>
<div class="codesnip-container" >
<pre>
C:\Programme\KrView\Kernrates&gt;Kernrate_i386_XP.exe
 /==============================\

 \==============================/
Date: 2009/12/24   Time: 14:46:59
Machine Name: OTTOSPC
Number of Processors: 1
PROCESSOR_ARCHITECTURE: x86
PROCESSOR_LEVEL: 15
PROCESSOR_REVISION: 2f02
Physical Memory: 2047 MB
Pagefile Total: 2613 MB
Virtual Total: 2047 MB
PageFile1: \??\C:\pagefile.sys, 720MB
OS Version: 5.1 Build 2600 Service-Pack: 3.0
WinDir: C:\WINDOWS

Kernrate User-Specified Command Line:
Kernrate_i386_XP.exe

Kernel Profile (PID = 0): Source= Time,
Using Kernrate Default Rate of 25000 events/hit
Starting to collect profile data

***&gt; Press ctrl-c to finish collecting profile data
===&gt; Finished Collecting Data, Starting to Process Results

------------Overall Summary:--------------

P0     K 0:00:19.562 (59.4%)  U 0:00:00.078 ( 0.2%)  I 0:00:13.281 (40.3%)  DPC 0:00:00.000 ( 0.0%)  Interrupt 0:00:19.3
43 (58.8%)
       Interrupts= 14033581, Interrupt Rate= 426269/sec.

Total Profile Time = 32921 msec

                                       BytesStart          BytesStop         BytesDiff.
    Available Physical Memory   ,      1396867072,      1396502528,         -364544
    Available Pagefile(s)       ,      2206572544,      2206597120,           24576
    Available Virtual           ,      2132484096,      2131435520,        -1048576
    Available Extended Virtual  ,               0,               0,               0

                                  Total      Avg. Rate
    Context Switches     ,         8041,         244/sec.
    System Calls         ,        71045,         2158/sec.
    Page Faults          ,          447,         14/sec.
    I/O Read Operations  ,          195,         6/sec.
    I/O Write Operations ,           36,         1/sec.
    I/O Other Operations ,          972,         30/sec.
    I/O Read Bytes       ,        73962,         379/ I/O
    I/O Write Bytes      ,         8838,         246/ I/O
    I/O Other Bytes      ,        86695,         89/ I/O

-----------------------------

Results for Kernel Mode:
-----------------------------

OutputResults: KernelModuleCount = 132
Percentage in the following table is based on the Total Hits for the Kernel

Time   13125 hits, 25000 events per hit --------
 Module                                Hits   msec  %Total  Events/Sec
ati2mtag                               6477      32921    49 %     4918592
hal                                    6284      32921    47 %     4772030
ntkrnlpa                                196      32921     1 %      148841
VIDEOPRT                                 54      32921     0 %       41007
win32k                                   46      32921     0 %       34932
ati2dvag                                 27      32921     0 %       20503
ati3duag                                  8      32921     0 %        6075
ati2cqag                                  7      32921     0 %        5315
USBPORT                                   7      32921     0 %        5315
naveng                                    3      32921     0 %        2278
atikvmag                                  3      32921     0 %        2278
usbccgp                                   2      32921     0 %        1518
Ntfs                                      2      32921     0 %        1518
navex15                                   1      32921     0 %         759
watchdog                                  1      32921     0 %         759
SPBBCDrv                                  1      32921     0 %         759
SYMTDI                                    1      32921     0 %         759
SYMEVENT                                  1      32921     0 %         759
savrt                                     1      32921     0 %         759
usbehci                                   1      32921     0 %         759
CLASSPNP                                  1      32921     0 %         759
ACPI                                      1      32921     0 %         759

================================= END OF RUN ==================================
============================== NORMAL END OF RUN ==============================
</pre>
</div>
<p>It looks like the module &#8220;ati2mtag&#8221; consumed most CPU cycles.</p>
<h3>Resolution</h3>
<p>A quick web search later I had the <a href="http://www.tomshardware.co.uk/forum/page-252339_15_0.html" target="_blank">solution</a>: ATIs catalyst drivers seem to have a problem in certain scenarios that is related to HD audio. Disabling &#8220;Microsoft UAA Bus Driver for High Definition Audio&#8221; in Device Manager fixed this issue for me.</p>
<p>Here is a screen shot from Task Manager right after disabling said audio driver:</p>
<p><a href="http://blogs.sepago.de/helge/files/2010/01/Task-Manager-2.gif" rel="lightbox[id1299]"><img src="http://blogs.sepago.de/helge/files/2010/01/Task-Manager-2.gif" alt="Task Manager 2" width="455" height="589" class="alignnone size-full wp-image-1300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.sepago.de/helge/2010/01/04/how-to-analyze-kernel-performance-bottlenecks-and-find-that-atis-catalyst-drivers-cause-50-cpu-utilization/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
