<?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>(iBoyd) &#187; Work</title>
	<atom:link href="http://iboyd.net/index.php/category/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://iboyd.net</link>
	<description></description>
	<lastBuildDate>Tue, 29 Jun 2010 16:46:24 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Windows 7 Power Management: Fixing PC Insomnia</title>
		<link>http://iboyd.net/index.php/2010/05/16/windows-7-power-management-fixing-pc-insomnia/</link>
		<comments>http://iboyd.net/index.php/2010/05/16/windows-7-power-management-fixing-pc-insomnia/#comments</comments>
		<pubDate>Sun, 16 May 2010 07:25:23 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[pc insomnia]]></category>
		<category><![CDATA[pc narcolepsy]]></category>
		<category><![CDATA[power management]]></category>
		<category><![CDATA[power options]]></category>
		<category><![CDATA[powercfg]]></category>
		<category><![CDATA[standby]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=300</guid>
		<description><![CDATA[As I&#8217;ve mentioned before, putting workstations into a low power standby mode when not in use is a great way to save money. Unfortunately, standby doesn&#8217;t always work like it should. Many sysadmins have struggled with applications, settings, and even system drivers that prevent standby from working reliably, or working at all. There were many [...]]]></description>
			<content:encoded><![CDATA[<p>As I&#8217;ve mentioned before, putting workstations into a low power standby mode when not in use is a great way to save money. Unfortunately, standby doesn&#8217;t always work like it should. Many sysadmins have struggled with applications, settings, and even system drivers that prevent standby from working reliably, or working at all.</p>
<p>There were many scenarios in past versions of Windows where workstations configured to  enter standby after a certain period of idle time would refuse to do so, often  without many clues as to why. This behavior is commonly (and cleverly) referred to as PC insomnia. While Windows 7 computers can still  suffer from insomnia, the latest Windows OS now includes new tools and settings to troubleshoot and resolve it.  There are a variety of things that may prevent a computer from properly entering standby when idle. Common reasons include hardware driver issues, service issues, and open file shares. Windows XP did not include any tools that could help pinpoint what was keeping the system awake, which often made finding the culprit a guessing game. Thankfully, the command line utility POWERCFG.EXE was updated in Windows 7 to include two new options that assist with tracking down insomnia issues.</p>
<p>If you haven&#8217;t already, you should check out my <a href="http://iboyd.net/index.php/2010/05/07/windows-7-power-management-applying-power-settings-with-powercfg/" target="_blank">previous article</a> about power management in Windows 7 in order to learn about power profiles and POWERCFG.EXE commands.</p>
<h3>POWERCFG -REQUESTS</h3>
<p>One way to troubleshoot Windows 7 insomnia issues, is the POWERCFG.EXE -REQUESTS command. This command can be used to display a list of applications and drivers that have made requests to prevent the computer from entering standby.</p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_302" class="wp-caption aligncenter" style="width: 648px;">
<dt class="wp-caption-dt"><a href="http://iboyd.net/wp-content/uploads/2010/05/powerconfig-requests.jpg" rel="lightbox[300]"><img class="size-full wp-image-302  " title="POWERCFG -REQUESTS" src="http://iboyd.net/wp-content/uploads/2010/05/powerconfig-requests.jpg" alt="Example output from the powercfg -requests command" width="638" height="326" /></a></dt>
</dl>
</div>
<p>In the example above, there are actually two Windows components that are preventing the system from entering standby. The first issue is that Windows wants to keep this particular computer awake because a remote host is connected to a share on the computer . If this computer was acting as a network file server, that would probably be a good thing. But it&#8217;s not, so we either need to prevent the computer from sharing files at all, or allow it to enter standby regardless of whether a remote host is connected to a file share. The other issue is that Windows wants to keep this computer awake because it&#8217;s connected to a remote file share. While there are probably cases where this behavior is desired, I want Windows to enter standby regardless of whether or not the computer is connected to a remote network share. Otherwise, most workstations would never enter standby! Both of these issues can normally resolved by changing a few hidden power options, which is covered later in this article.</p>
<h3>POWERCFG -ENERGY</h3>
<p>In a some cases, it may also be useful run POWERCFG.EXE -ENERGY. This command performs a more thorough investigation  in order find potential power management issues, such as those that may be preventing standby. When POWERCFG -ENERGY is run, it detects common issues by monitoring the system for a period of time and capturing system settings and events that may be preventing Windows power management from working properly. When done, the results are written to a HTML file.</p>
<p>By default, POWERCFG.EXE -ENERGY analyzes the system for 60 seconds. However,  the analysis duration can be be set to a larger period of time to detect more sporadic events that are preventing standby. To perform an analysis for 10 minutes, run POWERCFG -ENERGY -DURATION 600. When finished, the results are written to energy-report.html,  or the filename specified with -OUTPUT &lt;FILENAME&gt;.</p>
<p style="text-align: left;">
<div class="mceTemp mceIEcenter">
<dl id="attachment_301" class="wp-caption aligncenter" style="width: 512px;">
<dt class="wp-caption-dt"><a href="http://iboyd.net/wp-content/uploads/2010/05/energy-report.jpg" rel="lightbox[300]"><img class="size-large wp-image-301   " title="Windows 7 Energy Report" src="http://iboyd.net/wp-content/uploads/2010/05/energy-report-1024x856.jpg" alt="An example of the output generated by POWERCFG.EXE -ENERGY" width="502" height="419" /></a></dt>
</dl>
</div>
<p>While this report is more thorough that POWERCFG -REQUESTS, it may include items that aren&#8217;t necessarily related to issues with standby. For example, the report above shows the error <strong>USB Suspend:USB Device not Entering Suspend </strong>for several USB devices on this computer<strong>. </strong>While this may affect the computer&#8217;s power efficiency at some level,  it&#8217;s not the reason that this computer was entering standby. In this case, the standby was being blocked by the  <strong>System Required Request </strong>initiated by the driver <strong>\FileSystem\srvnet</strong>. This is related to the Windows network shares, and indicated to me that that standby was  being blocked because a remote host was trying to connect to a share on the client computer. I wasn&#8217;t able to see this when running POWERCFG -REQUESTS alone.</p>
<h3>Manually Checking Services</h3>
<p>If neither of the tools mentioned above help pinpointthe cause of insomnia, you may want to try manually verifying that Windows Services aren&#8217;t preventing standby. This troubleshooting method is simple, but a bit tedious:</p>
<ol>
<li>First, go to<strong> Start &gt; Control Panel &gt; Power Options</strong> and configure the current power profile so that the system enters standby after 1 minute.</li>
<li>Go to <strong>Start &gt; Control Panel &gt; Administrative Tools &gt; Services</strong>. Sort the services by the status column.</li>
<li>One by one, stop services that are running. Each time you stop a service, let the computer idle for at least 2 minutes to see if it enters standby. Continue doing this until the computer enters standby. It&#8217;s probably best to begin with non-Windows services.</li>
<li>If/when the computer finally enters standby after you&#8217;ve stopped a service, make note of that service. Restart the computer so that all services are running again. Stop that particular service again and wait for the computer to idle into standby.</li>
<li>If the computer idles to standby, you have found the service that is preventing system standby.</li>
</ol>
<p>What services could be causing insomnia? Some anti-virus applications have been known to prevent the system from entering standby for various reasons. Older or poorly-written services may also be the cause of PC insomnia.</p>
<h2>Treating Insomnia</h2>
<p>Windows 7 includes several power settings that may be useful for resolving PC insomnia. Interestingly, some of them are hidden and must be enabled in the system registry. Below are some common settings and methods for treating insomnia.</p>
<h3><strong>Allow Standby with Remote Opens<br />
</strong></h3>
<p>By default, Windows 7 will attempt to prevent system standby when connected to a  a remote share or file. Presumably, this is to prevent any ongoing file transfers over the network from failing due to the system unexpectedly entering standby. But there are many cases where the system is connected to a remote share and it is okay to enter standby. Windows 7 includes a setting to allow the computer to enter standby, but it may be missing from the advanced power options dialog box. This .reg file will unhide the &#8220;Allow sleep with remote opens&#8221; option AND set it to Yes for three default power profiles (Balanced, High Performance, and Power Saver) in Windows 7:</p>
<pre class="brush:plain">Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d]
"Attributes"=dword:00000000

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d\DefaultPowerSchemeValues\381b4222-f694-41f0-9685-ff5bb260df2e]
"ACSettingIndex"=dword:00000001
"DCSettingIndex"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d\DefaultPowerSchemeValues\8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c]
"ACSettingIndex"=dword:00000001
"DCSettingIndex"=dword:00000001

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d\DefaultPowerSchemeValues\a1841308-3541-4fab-bc81-f71556f20b4a]
"ACSettingIndex"=dword:00000001
"DCSettingIndex"=dword:00000001
</pre>
<p>Although the registry entries above will configure the three default power profiles, it won&#8217;t apply the settings to custom power profiles. To do that, you&#8217;ll need to find the Power Scheme GUID of the power profile you created by using POWERCFG.EXE /LIST and then run these commands:</p>
<pre class="brush:plain">POWERCFG.EXE /SETACVALUEINDEX &lt;POWER SCHEME GUID&gt; 238c9fa8-0aad-41ed-83f4-97be242c8f20 d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d 1
POWERCFG.EXE /SETDCVALUEINDEX &lt;POWER SCHEME GUID&gt; 238c9fa8-0aad-41ed-83f4-97be242c8f20 d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d 1</pre>
<h3><strong>Allow Standby when Sharing Media<br />
</strong></h3>
<p>If the system is configured with file or media sharing enabled, Windows 7 may prevent the system from entering standby while users are connected to files or shares hosted on the system in order to prevent file transfers from being interrupted. Sometimes, media, file, and printer sharing may be enabled on the  workstation without the user or the sysadmin knowing it. To make matters  worse, there are some network applications installed that tend to scan  network shares at regular intervals, which may prevent standby.</p>
<p>This behavior can be disabled by setting  &#8220;When sharing media&#8221; to &#8220;Allow Computer to Sleep&#8221; within the advanced settings of a power profile. The setting shouldn&#8217;t be hidden by default. To apply this setting to a custom Windows 7 power profile, these commands can be used:</p>
<pre class="brush:plain">POWERCFG.EXE /SETACVALUEINDEX &lt;POWER SCHEME GUID&gt; 9596fb26-9850-41fd-ac3e-f7c3c00afd4b 03680956-93bc-4294-bba6-4e0f09bb717f 0
POWERCFG.EXE /SETDCVALUEINDEX &lt;POWER SCHEME GUID&gt; 9596fb26-9850-41fd-ac3e-f7c3c00afd4b 03680956-93bc-4294-bba6-4e0f09bb717f 0</pre>
<h3><strong>Add Power Request Override</strong></h3>
<p>While <a title="SetExecutionThreadState can be used to tell the system to stay out of standby." href="http://msdn.microsoft.com/en-us/library/Aa373208" target="_blank">applications can request that Windows to keep the system awake</a>, that doesn&#8217;t mean that the OS should always listen. Applications make power requests like this for several reasons. For example, Windows Update may make a  request keep to computer awake while updates are being installed or a  reboot is pending. It&#8217;s actually very easy to implement a power request that blocks standby, which means it could be abused by a service or process that <em>thinks</em> it knows what&#8217;s good for it. If the results from POWERCFG -REQUESTS or POWERCONFIG -ENERGY show that a particular service or process is making a lot of unnecessary power requests, there is a way in Windows 7 to ignore those requests. To learn more about overriding a power requests, browse to the &#8220;Overriding a Power Request&#8221; section of this <a href="http://www.microsoft.com/whdc/system/pnppwr/powermgmt/AvailabilityRequests.mspx" target="_blank">Microsoft paper</a>.</p>
<h3>Don&#8217;t Allow System Required Policy</h3>
<p>If you&#8217;ve tried everything but still can&#8217;t get that  insomniac system to enter standby when idle, there is one last setting that you can use in a last ditch attempt.</p>
<p>However,the &#8220;Allow System Required Policy&#8221; power setting may also cause Windows to ignore valid requests to keep the computer awake. Therefore, this setting should only be used if nothing else works and you&#8217;ve tried using a Power Request Override to ignore specific drivers, processes, and services. This registry entry will unhide the setting:</p>
<pre class="brush:plain">Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\A4B195F5-8225-47D8-8012-9D41369786E2]
"Attributes"=dword:00000000
</pre>
<p>To disable power request overrides for a power profile, these commands can be used:</p>
<pre class="brush:plain">POWERCFG.EXE /SETACVALUEINDEX &lt;POWER SCHEME GUID&gt; 238C9FA8-0AAD-41ED-83F4-97BE242C8F20 A4B195F5-8225-47D8-8012-9D41369786E2 0
POWERCFG.EXE /SETDCVALUEINDEX &lt;POWER SCHEME GUID&gt; 238C9FA8-0AAD-41ED-83F4-97BE242C8F20 A4B195F5-8225-47D8-8012-9D41369786E2 0</pre>
<h2>What about Narcolepsy?</h2>
<p>Another common issue with Windows systems that enter standby is <em>PC Narcolepsy.  PC Narcolepsy</em> refers to a behavior of the Windows Operating System, where a computer that resumes standby from a Wake-on-LAN (WOL) or scheduled wakeup event will enter standby again after 2 minutes unless there is user interaction, such as pressing a key on the mouse or keyboard. In Windows XP, there wasn&#8217;t any way to change this behavior. Fortunately, Windows 7 introduces a new power option that can change the amount of time that the computer resumes from standby:  <em>System unattended sleep timeout</em>. However this setting is hidden in the power profile by default. Why is it hidden? I&#8217;m not quite sure. Perhaps because it could be confused with the standby timeout setting. It can be unhidden using this reg file:</p>
<pre class="brush:plain">Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\238C9FA8-0AAD-41ED-83F4-97BE242C8F20\7bc4a2f9-d8fc-4469-b07b-33eb785aaca0]
"Attributes"=dword:00000000
</pre>
<p>Once unhidden, this setting will be visible in the advanced power options dialog. However, most sysadmins need a way to automate the configuration of this setting. Like several of the settings above, this can be done if you know the GUID of the power profile that you want to set this setting on:</p>
<pre class="brush:plain">POWERCFG.EXE /SETACVALUEINDEX &lt;POWER SCHEME GUID&gt; 238c9fa8-0aad-41ed-83f4-97be242c8f20 7bc4a2f9-d8fc-4469-b07b-33eb785aaca0 &lt;DURATION IN SECONDS&gt;
POWERCFG.EXE /SETDCVALUEINDEX &lt;POWER SCHEME GUID&gt; 238c9fa8-0aad-41ed-83f4-97be242c8f20 7bc4a2f9-d8fc-4469-b07b-33eb785aaca0 &lt;DURATION IN SECONDS&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2010/05/16/windows-7-power-management-fixing-pc-insomnia/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Windows 7 Power Management: Applying Power Settings with POWERCFG</title>
		<link>http://iboyd.net/index.php/2010/05/07/windows-7-power-management-applying-power-settings-with-powercfg/</link>
		<comments>http://iboyd.net/index.php/2010/05/07/windows-7-power-management-applying-power-settings-with-powercfg/#comments</comments>
		<pubDate>Fri, 07 May 2010 14:14:58 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[power management]]></category>
		<category><![CDATA[powercfg]]></category>
		<category><![CDATA[standby]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=327</guid>
		<description><![CDATA[Between Windows XP and Windows 7, Microsoft made significant changes under the hood to power management in order to make Windows a more energy efficient OS. While Windows Vista included a significant number of changes to power management, it really seems like Microsoft put much more effort into making Windows 7 more power efficient after [...]]]></description>
			<content:encoded><![CDATA[<p>Between Windows XP and Windows 7, Microsoft made significant changes  under the hood to power management in order to make Windows a more  energy efficient OS. While Windows Vista included a significant number  of changes to power management, it really seems like Microsoft put much  more effort into making Windows 7 more power efficient after complaints  about terrible battery life with Windows Vista. <a title="Windows 7  Power Management" href="http://download.microsoft.com/download/8/5/4/854f66b6-8c09-4f8a-986e-38e9ebac1677/windows7_power_management_whitepaper.pdf" target="_blank">This PDF</a> provides a general overview of these  changes. Many of the changes work out of the box, which is great for overworked sysadmins. However, there are a few settings that need to  be configured as needed, particularly when it comes to system idle and  standby settings. With Windows 7, Microsoft has included several  additional features and troubleshooting tools that address some of the  headaches caused by power management in Windows XP.</p>
<h2>Standby Me</h2>
<p>Before we dive into the guts of power management in Windows 7, let&#8217;s  discuss the value of taking the time to configure power management  settings.  Since <em>going green </em>is a hot trend right now, many  companies are starting to put pressure on sysadmins to find ways to  squeeze power savings from a major offender to the energy grid: Computers. At many companies, workstations are left running 24&#215;7,  even when not in use. If the work week is only 40 hours, that means that  many of these computers are in a Powered On with Nothing to Do (POND)  state for 100+ hours per week.  <a title="Ford saves 1.2 million by  turning computers off" href="http://www.treehugger.com/files/2010/03/ford-saves-more-than-1-million-dollars-by-turning-computers-off.php" target="_blank">As Ford recently discovered</a>, turning computers off  when they are not in use is a great way to reduce energy waste and save  some serious coin!</p>
<p>One disadvantage to turning off computers completely when not in use  is that, when a user needs to use the computer again, they have to wait  for the  computer to start up, then log in, then load applications and  documents  again. Admittedly, this a bit time consuming and frustrating  for an end user.  Therefore, many sysadmins opt to put computers into a  low power standby mode as a fair compromise between user experience and  energy savings. Standby mode, which powers down most system components  as suspends the system state to RAM, allows the user <em>instantly resume </em>where they left off when they last used the computer. In modern  computers, standby only consumes slightly more power than when in a  powered off state.</p>
<h2>Applying Settings with POWERCFG<strong><strong><br />
</strong></strong></h2>
<p>If you&#8217;ve used the POWERCFG utility in Windows XP, you&#8217;ll probably  find one major difference in Windows 7: GUIDs. In Windows XP, a power  scheme could be configured by specifying the name of the scheme in the  POWERCFG command line syntax. In Windows 7, that is no longer an option.  Instead, you must specify the GUID associated with a particular power  scheme when configuring and activating a scheme. While POWERCFG in  Windows 7 still includes a way to change the monitor, disk, and standby  timeouts of the <em>active </em>scheme, it takes some understanding of the  Windows 7 power management GUIDs to do anything beyond that. Not only  are the power schemes themselves identified by GUIDs, Windows 7 uses  GUIDs to uniquely identify settings and groups of settings as well. While the idea of working with GUIDs may seem like a daunting task, it&#8217;s actually pretty easy to wrap your head around once you  know how to find and use these GUIDs.</p>
<p>The most straightforward  way to get a list of power scheme, group, and setting GUIDs is to run <strong>POWERCFG  -QUERY</strong>. As a side note, this command tends to generate a lot of  output, so it may be wise to pipe the output to a file like this:</p>
<pre>POWERCFG.EXE -QUERY &gt; powercfg.txt
</pre>
<p>After  running the command, the current directory should contain the  powercfg.txt file with the output from POWERCFG &#8211; QUERY inside of it.  Here&#8217;s what it looks like:</p>
<p style="text-align: center;"><a href="http://iboyd.net/wp-content/uploads/2010/05/powercfg-query.jpg" rel="lightbox[327]"><img class="aligncenter size-full wp-image-322" title="POWERCFG -QUERY" src="http://iboyd.net/wp-content/uploads/2010/05/powercfg-query.jpg" alt="An example of the output from the POWERCFG -QUERY command" width="656" height="455" /></a></p>
<p>As you can see from the example  above, POWERCFG -QUERY provides very detailed information about every  power scheme and setting set in power options in a nicely indented  format. At the top is the GUID associated with the power scheme (High  Performance). Directly below that is the GUID that identifies the first  subgroup of settings (settings belonging to no subgroup). The GUIDs that  identify each setting are directly below that, with information about  possible setting values.</p>
<h3>Example</h3>
<p>Let&#8217;s say we  wanted to change the setting <strong>Require a Password on Wakeup</strong> to <strong>No</strong> within  the <strong>High Performance</strong> power scheme. First, we need to use the output  from POWERCFG -QUERY to find the associated GUIDs and setting index:</p>
<p><a href="http://iboyd.net/wp-content/uploads/2010/05/powercfg-query-highlight.jpg" rel="lightbox[327]"><img title="powercfg-query-highlight" src="http://iboyd.net/wp-content/uploads/2010/05/powercfg-query-highlight.jpg" alt="The output of POWERCFG -QUERY that highlights the GUIDs used in  this example." width="607" height="144" /></a></p>
<p>These values are  then plugged into commands <strong>POWERCFG -SETACVALUEINDEX</strong> and <strong>POWERCFG  -SETDCVALUEINDEX</strong>:</p>
<pre class="brush:plain">POWERCFG -SETACVALUEINDEX 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c fea3413e-7e05-4911-9a71-700331f1c294 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 0
POWERCFG -SETDCVALUEINDEX 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c fea3413e-7e05-4911-9a71-700331f1c294 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 0</pre>
<p>As you may have  guessed, the first command affects the computer while it&#8217;s plugged in.  The second affects the computer while on battery. There&#8217;s a few things  that have been implied in this example, but are worth covering in case  you plan to script power settings for a fleet of computers:</p>
<ul>
<li>Windows  includes three built-in power schemes: Balanced, High Performance, and  Power Saver. These schemes are identified by the same GUID on every  Windows 7 computer.</li>
<li>The GUIDs that identify subgroups and  power settings are the same on every Windows 7 computer.</li>
<li>To  create a new scheme, use this command:
<pre class="brush:plain">POWERCFG -DUPLICATESCHEME &lt;POWER SCHEME GUID&gt; &lt;NEW GUID&gt;
</pre>
<p>The  &lt;NEW GUID&gt; parameter is optional. If it is not specified, POWERCFG will  automatically generate a new GUID.</li>
<li>Remember that if  &lt;NEW GUID&gt; is omitted, the GUID that identifies your new scheme will be  different on each computer that you run this command on.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2010/05/07/windows-7-power-management-applying-power-settings-with-powercfg/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Visual Basic: Parse Command Line Arguments from a String</title>
		<link>http://iboyd.net/index.php/2009/12/01/visual-basic-parse-command-line-arguments-from-a-string/</link>
		<comments>http://iboyd.net/index.php/2009/12/01/visual-basic-parse-command-line-arguments-from-a-string/#comments</comments>
		<pubDate>Tue, 01 Dec 2009 01:15:26 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Command Line]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[System.Diagnostics.Process]]></category>
		<category><![CDATA[Visual Basic]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=241</guid>
		<description><![CDATA[Sometimes I write code that I think I need but never end up using. This was the case with the parseCommandLineString() function that I wrote in Visual Basic .NET. I needed a function that would take a command line string that included arguments and parse it in the same way that Environment.ParseCommandLineArgs() does. Why? Because [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I write code that I think I need but never end up using. This was the case with the parseCommandLineString() function that I wrote in Visual Basic .NET. I needed a function that would take a command line string that included arguments and parse it in the same way that <strong>Environment.ParseCommandLineArgs()</strong> does. Why? Because <strong>System.Diagnostics.ProcessStartInfo</strong> uses two properties that separate the executable file name from the arguments. Why Microsoft left this functionality out of the framework is beyond me. Anyway, there is a method build into the Windows API that can parse arguments from a command line string: <strong>CommandLineToArgv()</strong>. Unfortunately, calling it in VB .NET requires Marshalling and I couldn&#8217;t find a good example online. Here&#8217;s my code:</p>
<pre class="brush:vbnet">
    Private Declare Function CommandLineToArgv Lib "shell32.dll" Alias "CommandLineToArgvW" (ByVal lpCmdLine As String, ByRef pNumArgs As Integer) As Long
    '''
    ''' Summary: Parse the command line string so that it can be used with System.Diagnostics.Process. I chose to use the Windows API here to ensure that the command line parsing is consistent with how Windows handles it.
    '''
    ''' Parameter command: The string that should be parsed
    ''' Returns: An array of command line arguments similar to what Environment.GetCommandLineArgs() produces.
    ''' It sure would be nice if the framework had a method for doing this. It becomes a drawback of using System.Diagnostics.Process, which requires arguments to be separated from the executable.
    Private Function parseCommandLineString(ByVal command As String) As String()
        Dim numargs As Integer
        Dim t As Integer
        Dim ptrCommand As IntPtr = Marshal.StringToHGlobalUni(command) 'Marshal the string to a pointer
        Dim ptrSplitArgs As IntPtr = CommandLineToArgv(ptrCommand, numargs) 'Pass the pointer to CommandLineToArgv for parsing, retrieve the pointer of the result.
        If ptrSplitArgs = IntPtr.Zero Then Throw New System.ComponentModel.Win32Exception 'Is it a valid pointer? Throw an exception if it isn't.
        Dim splitargs(numargs - 1) As String

        For t = 0 To numargs - 1
            splitargs(t) = Marshal.PtrToStringUni(Marshal.ReadIntPtr(ptrCommand, t * IntPtr.Size)).Trim  'Iterate through the arguments and add them to an array.
        Next
        Marshal.FreeHGlobal(ptrCommand)
        Marshal.FreeHGlobal(ptrSplitArgs)
        Return splitargs

    End Function</pre>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2009/12/01/visual-basic-parse-command-line-arguments-from-a-string/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 7 is Missing NETDOM.EXE</title>
		<link>http://iboyd.net/index.php/2009/10/23/windows-7-is-missing-netdom-exe/</link>
		<comments>http://iboyd.net/index.php/2009/10/23/windows-7-is-missing-netdom-exe/#comments</comments>
		<pubDate>Fri, 23 Oct 2009 01:49:45 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[ITS]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[join domain]]></category>
		<category><![CDATA[netdom]]></category>
		<category><![CDATA[powershell]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=224</guid>
		<description><![CDATA[UPDATE: I discovered that there is a working NETDOM.EXE for Windows 7. Here&#8217;s what you need to do (on a Windows 7 machine) to get it: Install the Remote Server Administration Tools (RSAT). Go to Control Panel -&#62; Programs and Features -&#62; Turn Windows features on or off In the treeview, go to Remote Server [...]]]></description>
			<content:encoded><![CDATA[<p><span style="text-decoration: underline;"><strong>UPDATE:</strong></span> I discovered that there is a working NETDOM.EXE for Windows 7. Here&#8217;s what you need to do (on a Windows 7 machine) to get it:</p>
<ol>
<li>Install the <a title="Download Remote Server Administration Tools" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=7D2F6AD7-656B-4313-A005-4E344E43997D&amp;displaylang=en" target="_blank">Remote Server Administration Tools (RSAT)</a>.</li>
<li>Go to <strong>Control Panel -&gt; Programs and Features -&gt; Turn Windows features on or off</strong></li>
<li>In the treeview, go to <strong>Remote Server Administration Tools -&gt; Role Administration Tools -&gt; AD DS and AD LDS Tools</strong> and select <strong>AD DS Tools</strong>. Click OK.</li>
</ol>
<p>NETDOM should be located in your SYSTEM32 folder. If would rather use Powershell to join the domain, since it&#8217;s included with the Windows 7 RTM, then please continue reading. I apologize for any confusion.</p>
<p><em>(Begin Original Post)</em></p>
<p>Now that the title of this post has your attention, I can tell you that Windows 7 isn&#8217;t really missing this important tool that joins a machine to an Active Directory Domain in an automated fashion. Instead, this command-line utility has been superseded by a new command that&#8217;s included in Microsoft&#8217;s love-it-or-hate-it command line shell: Windows Powershell. Why? Well, Powershell is certainly more powerful than the standard command prompt. But more importantly, Windows 7 is the first version to include Windows Powershell in the RTM build. With Powershell built into Windows 7, perhaps Microsoft saw no reason to continue including and supporting our old pal, NETDOM.</p>
<h4>Joining a Domain with Add-Computer</h4>
<p>When you&#8217;re finished grieving over the loss of our beloved NETDOM, which has joined countless computers to countless Windows Domains (or far inferior Workgroups), it&#8217;s time to roll up your sleeves and start working with the successor command: Add-Computer. This command will <span style="text-decoration: underline;">only</span> run in a Windows Powershell command prompt. The good news, however, is that you can easily run Add-Computer inside Powershell through a normal command prompt (or batch file). To do so, open a command prompt (with elevated privileges) and run this command:</p>
<pre style="padding: 10px 0px; overflow: auto; width: 100%; background-color: #e3e3e3;">powershell Add-Computer -DomainName "YOURDOMAIN"</pre>
<p>See? That wasn&#8217;t so bad now was it? If you don&#8217;t mind entering credentials to join the domain on every single computer, that&#8217;s all you need. But unfortunately, some of us need to automate the process of joining the domain. For that, it gets more complex, and we&#8217;ll need a bit more Powershell to make it work.</p>
<div id="attachment_225" class="wp-caption alignright" style="width: 310px"><a href="http://iboyd.net/wp-content/uploads/2009/10/powershell-add-computer.jpg" rel="lightbox[224]"><img class="size-medium wp-image-225" title="powershell-add-computer" src="http://iboyd.net/wp-content/uploads/2009/10/powershell-add-computer-300x152.jpg" alt="Screenshot: Add-Computer -?" width="300" height="152" /></a><p class="wp-caption-text">Screenshot: Add-Computer -?</p></div>
<h4>How to Use Add-Computer</h4>
<p>From a command prompt, you can get more detailed usage instructions for Add-Computer by using this command:</p>
<pre style="padding: 10px 0px; overflow: auto; width: 100%; background-color: #e3e3e3;">powershell Add-Computer -?</pre>
<p>In the syntax section, you&#8217;ll find syntax switches that can be used to specify the domain name, OU path, and credentials.  For a more details and examples on Add-Computer, you can also use this command:</p>
<pre style="padding: 10px 0px; overflow: auto; width: 100%; background-color: #e3e3e3;">powershell get-help Add-Computer -detailed</pre>
<p>The first thing you should notice is that, unlike NETDOM, there aren&#8217;t syntax switches to specify the username and password. Instead, there is a switch called &#8220;-Credential&#8221; that takes in a PSCredential object. Therefore, we need to create a PSCredential object with the credentials that will be used to join the computer to the domain before we can actually use the Add-Computer command in an automated way. To do this, we&#8217;ll need to create a Powershell script.</p>
<p>If you have never used Powershell before, you&#8217;ll probably say to yourself, &#8220;PSCredential object? What is that!?&#8221;  I&#8217;ll give you this very brief explanation: PSCredential is an object that can securely store Windows credentials. Furthermore, Powershell is  more like full-blown Object-Oriented scripting language than a shell language. Like DOS, it has a command prompt. However, the differences usually end there.  Anyway, this article isn&#8217;t about Powershell, but if you want to know more about it, <a title="Google Search for Powershell" href="http://www.google.com/search?q=powershell" target="_blank">start Googling</a>. Or you can just continue on to get the Powershell script.</p>
<h4>A Powershell Script to Join the Domain</h4>
<p>The Powershell script needed to join the domain contains only two commands.  Create a new text file named &#8220;joinDomain.ps1&#8243; and put the following powershell code into it:</p>
<pre style="padding: 10px 0px; overflow: auto; width: 100%; background-color: #e3e3e3;">$credential = New-Object System.Management.Automation.PsCredential("MY.DOMAIN.COM\user", (ConvertTo-SecureString "mypassword" -AsPlainText -Force))
Add-Computer -DomainName "MY.DOMAIN.COM" -Credential $credential -OUPath ("OU=Computers,DC=MY,DC=DOMAIN,DC=COM")</pre>
<p>The first line of the script creates a new <a title="MSDN: PsCredential" href="http://msdn.microsoft.com/en-us/library/system.management.automation.pscredential.pscredential%28VS.85%29.aspx" target="_blank">System.Management.Automation.PsCredential</a> object. PsCredential takes in two parameters: a string containing a username and a <a title="Technet: ConvertTo-SecureString" href="http://technet.microsoft.com/en-us/library/dd347656.aspx" target="_blank">secure string</a> containing the password.  You should change &#8220;MY.DOMAIN.COM\user&#8221; to the user that will join the computer to the domain. Change &#8220;mypassword&#8221; to the password of that account.</p>
<p>The second line is the Add-Computer command. &#8220;MY.DOMAIN.COM&#8221; should be changed to the domain that the computer is joining.  Change OUPath to the OU String that points to the OU container that the computer object should be placed in.</p>
<h4>Running the Script</h4>
<p>To run the Powershell script above, you need to open an elevated command prompt. To run it, type <strong>powershell ./joinDomain.ps1</strong> and press enter. In many cases, you will find that you&#8217;re not allowed to run the script, despite running the command as an administrator:</p>
<pre style="padding: 10px 0px; overflow: auto; width: 100%; background-color: #e3e3e3;">&gt;powershell ./joinDomain.ps1
<span style="color: #ff0000;">File joinDomain.ps1 cannot be loaded because the execution of scripts is disabled on this system. Please see "get-help about_signing" for more details.</span></pre>
<p>The funny part about Powershell is that, by default, it is configured to only allow the execution of signed scripts. This is a security feature so that unauthorized or malicious scripts that could compromise the system can&#8217;t be executed. After all, Powershell is quite power-ful. Unfortunately, this really tends to confuse and frustrate people. To get around this, you can temporarily change the execution policy, and then change it back:</p>
<pre style="padding: 10px 0px; overflow: auto; width: 100%; background-color: #e3e3e3;">powershell Set-ExecutionPolicy Unrestricted
powershell ./joinDomain.ps1
powershell Set-ExecutionPolicy Restricted</pre>
<p>You can also change the execution policy to allow only signed scripts and scripts created by you. For more information about the Powershell execution policy, <a title="Running Windows Powershell" href="http://www.microsoft.com/technet/scriptcenter/topics/winpsh/manual/run.mspx#E5B" target="_blank">check out this article</a>.</p>
<h3>Final Thoughts</h3>
<p>Now that you are able to automate a domain join with Powershell instead of NETDOM, there is one final thing that I want to mention. In the script above,  the password String was converted to a SecureString by using the &#8220;-AsPlainText -Force&#8221; arguments. Using SecureString in this way is generally discouraged as it defeats the whole purpose of having a secure string. Furthermore,  having account credentials in plain text with in the script is insecure and generally a bad idea. I&#8217;m guessing that this is the reason why Microsoft left out the &#8220;/userD&#8221; and &#8220;/passwordD&#8221; parameters from the NETDOM command and made it more slightly difficult to include the credentials in plain text. You should limit the rights of the account you&#8217;re using to automatically join the domain so that it cannot be used to delete Active Directory objects, access network shares, etc. You should also consider other methods of storing the credentials. <a title=" Using Get-Credential to Store Passwords “securely” in a file" href="http://bsonposh.com/archives/338" target="_blank">This article</a> has an alternative method for storing credentials used in Powershell that may meet your needs.</p>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2009/10/23/windows-7-is-missing-netdom-exe/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Windows PE 3.0 and the Missing WMI Class</title>
		<link>http://iboyd.net/index.php/2009/10/12/windows-pe-3-0-and-the-missing-wmi-class/</link>
		<comments>http://iboyd.net/index.php/2009/10/12/windows-pe-3-0-and-the-missing-wmi-class/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 14:46:07 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[ITS]]></category>
		<category><![CDATA[Work]]></category>
		<category><![CDATA[Sysprep]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows PE]]></category>
		<category><![CDATA[WinPE]]></category>
		<category><![CDATA[WMI]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=221</guid>
		<description><![CDATA[Since I maintain the Windows XP Image for our lab machines, I was tasked with doing the same thing with Windows 7. When I rewrote our imaging tools last Spring, I created a WinPE 2.0 image that included the WMI package so that the imaging application could perform WMI queries in PE. I used WMI [...]]]></description>
			<content:encoded><![CDATA[<p>Since I maintain the Windows XP Image for our lab machines, I was tasked with doing the same thing with Windows 7. When I rewrote our imaging tools last Spring, I created a WinPE 2.0 image that included the WMI package so that the imaging application could perform WMI queries in PE. I used WMI only to get basic information about the machine (Such as the Manufacturer, Model, Serial Number, and Disk Information).</p>
<p>While upgrading the WinPE image from 2.0 to 3.0 in anticipation of deploying Windows 7, I discovered that the Windows PE 3.0 base image (the same one that comes with the Windows AIK) was missing Win32_DiskPartition. I use this class to retrieve the number of partitions on the system disk so that I can make sure that each partitition (and its volume) has been assigned a drive letter so that I can search each drive for a preexisting configuration file. But why would Microsoft remove this class!? On a standard Windows 7 machine, the command &#8220;WMIC.EXE PARTITION&#8221; returned a list of partitions on the system, confirming that I wasn&#8217;t losing my mind. However, the command returned nothing when I tried it in Windows PE 3.0.</p>
<p>After lots of searching, I finally came across a <a title="Microsoft Technet Forums" href="http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/83defbc5-1cdb-470f-b5f1-f1fe6a61fc74" target="_blank">post on Microsoft Technet </a>where another developer ran into the same issue. Fortunately, he found a simple, but somewhat obscure, solution:</p>
<ol>
<li> On a fully-installed Windows 7 machine, copy the contents of C:\Windows\System32\wbem</li>
<li>Mount the Windows PE 3.0 image and replace the contents of &lt;mountdir&gt;\Windows\System32\wbem with the wbem folder from the previous step</li>
</ol>
<p>Using the Windows 7 wbem folder in your WinPE 3.0 image will make it several Megabytes larger, but at least you will be able to get to the missing WMI class(es) that you need!</p>
<p><span style="text-decoration: underline;"><strong>Update 3/11/2010</strong></span><strong>: </strong>After upgrading to the latest version of the Microsoft WAIK, I was unable to overwrite existing files in the WBEM folder (Access Denied). For some reason, the permissions are different on this folder now. Here is the workaround:</p>
<ol>
<li>To take ownership of the existing WBEM folder and files, run this command: TAKEOWN /F &lt;mountdir&gt;\windows\system32\wbem /A /R</li>
<li>To grant administrators full control of the existing WBEM folder and files, run this command: ICACLS &lt;mountdir&gt;\windows\system32\wbem /grant Administrators:F /T</li>
</ol>
<p>Once the permissions are updated, you will be able to overwrite files in the WBEM folder.</p>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2009/10/12/windows-pe-3-0-and-the-missing-wmi-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SCCM: Content downloaded to the client does not match the content specified in the content source</title>
		<link>http://iboyd.net/index.php/2009/01/11/sccm-content-downloaded-to-the-client-does-not-match-the-content-specified-in-the-content-source/</link>
		<comments>http://iboyd.net/index.php/2009/01/11/sccm-content-downloaded-to-the-client-does-not-match-the-content-specified-in-the-content-source/#comments</comments>
		<pubDate>Sun, 11 Jan 2009 20:09:36 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[downloads]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[sccm]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=119</guid>
		<description><![CDATA[There are some software packages that introduce a lot of interesting complexities that SCCM  2007 gets confused by. One of the applications that I was trying to test and deploy was giving me a particularly interesting problem: all of the clients downloaded the package, but when they checked the content, it did not match the [...]]]></description>
			<content:encoded><![CDATA[<p>There are some software packages that introduce a lot of interesting complexities that SCCM  2007 gets confused by. One of the applications that I was trying to test and deploy was giving me a particularly interesting problem: all of the clients downloaded the package, but when they checked the content, it did not match the source.</p>
<p>The error, which had an ID of 10057, was found by going to <strong>System Status -&gt; Advertisement Status -&gt; &lt;advertisement name&gt; -&gt; Show Messages on the actions pane</strong>:</p>
<blockquote><p><em>The program for advertisement &#8220;SIT00001 has failed because download of the content &#8220;SIT00029&#8243; &#8211; &#8220;Per-system unattended&#8221; has failed. The download failed because the content downloaded to the client does not match the content specified in the content source.</em></p>
<p><em>Possible causes: The content on the distribution point has been manually modified, or a local administrator on the computer has modified the content in the computer&#8217;s hash. Solution: Refresh the content on the distribution point and retry the download.</em></p></blockquote>
<p>The solution seemed obvious: update the distribution points. But multiple tries, including recreating the package and advertisement completely, did not fix the problem. Finally, I stumbled upon a forum post that helped me narrow the problem down to one of two scenarios:</p>
<p><strong>Binary Differential Replication &#8211; </strong>If this is enabled in the package configuration, some packages seem to fail. I&#8217;m assuming that they can&#8217;t handle this kind of replication and several of the files become corrupt, creating a hash mismatch. This can be turned off by opening up the package properties, going to the <strong>Data Source</strong> tab, and unchecking <strong>Enable binary differential replication</strong>. This wasn&#8217;t my problem because I hadn&#8217;t enabled binary differential replication.</p>
<p><strong>Hidden Files &#8211; </strong>Apparently, if the package source contains hidden files, SCCM may not calculate the correct hash for the package and clients could encounter an error. I found a quick way to check this using the command line:</p>
<ol>
<li>Open up a command window in the root director that contains your package source files.</li>
<li>Type <strong>Dir /S /A:H </strong>and hit enter. Depending on the package, you may be presented with several directories with multiple hidden files.</li>
<li>Trying to remove the hidden attribute on all the files with the GUI would be tedious, so just use this command instead: <strong>attrib -H /S</strong></li>
<li>Update the distribution points.</li>
</ol>
<p>The package finally verified properly and the advertisement completed.</p>
<p><strong><br />
</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2009/01/11/sccm-content-downloaded-to-the-client-does-not-match-the-content-specified-in-the-content-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Troubleshooting SCCM and BITS Downloads</title>
		<link>http://iboyd.net/index.php/2009/01/09/troubleshooting-sccm-and-bits-downloads/</link>
		<comments>http://iboyd.net/index.php/2009/01/09/troubleshooting-sccm-and-bits-downloads/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 16:58:53 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[advertisements]]></category>
		<category><![CDATA[BITS]]></category>
		<category><![CDATA[packages]]></category>
		<category><![CDATA[sccm]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=111</guid>
		<description><![CDATA[If you&#8217;re planning on using System Center Configuration Manager 2007 for its ability to distribute software over the internet and throttle large file transfers to avoid saturating the network, you may end up spending a lot of time scratching your head when packages start downloading to a client and then suddenly stop. Such was the [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re planning on using System Center Configuration Manager 2007 for its ability to distribute software over the internet and throttle large file transfers to avoid saturating the network, you may end up spending a lot of time scratching your head when packages start downloading to a client and then suddenly stop.</p>
<p>Such was the scenario I experienced while testing BITS with one of the applications we plan to deploy to clients. The client machine would begin the transfer and start the download&#8230; and then stop. Even worse, the issue never resolved itself, even when the machine was left running overnight. Since the issue was less-than-obvious (hint: It was not SCCM that was misconfigured) I decided to list a few tips in the BITS troubleshooting process that may be of use to others. <span id="more-111"></span></p>
<h2>Looking at the Client</h2>
<p>SCCM has no shortage of logs, but I have found that the useful information in them is often poorly filtered, poorly described, and generally difficult to find. This is especially true with many of the BITS issues. Here are a few places to look:</p>
<p><strong>C:\Windows\System32\CCM\Logs\DataTransferService.log</strong> &#8211; This is probably where you&#8217;re going to find an error. However, if you&#8217;re expecting it to jump out at you because you&#8217;re using the Trace32 tool, you may be surprised. Look for an error containing something like: <em>CDTSJob::JobError : DTS Job ID= { GUID }</em> . If you receive this error, you can be fairly sure that the transfer failed. You won&#8217;t get much more out if it.</p>
<p><strong>Bitsadmin /list /allusers &#8211; </strong><a href="http://msdn.microsoft.com/en-us/library/aa362813(VS.85).aspx" target="_blank">Bitsadmin</a> is a useful utility for manipulating and troubleshooting BITS transfers. Open up a command prompt and type <em>bitsadmin /list /allusers </em>or <em>bitsadmin /list /allusers /verbose &gt; bitslog.txt. </em>If you see your SCCM jobs stuck in an error state, you can be sure that something went awry. Your first instinct may be to try and delete or reset the jobs using <em>bitsadmin /reset /allusers. </em>However, I&#8217;ve found that this command is rarely successful. Like the logs, this utility seems to only be good for getting a diagnosis.</p>
<p><strong>HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\BITS &#8211; </strong>If you tried both of the command above and you <em>think </em>BITS is working, perhaps the client is using BITS download settings that are too low. These settings can be configured using ConfigMgr, but I&#8217;ve found that there is a delay between when this is set and when clients actually apply the settings (I&#8217;m still not sure exactly how long).<a href="http://iboyd.net/wp-content/uploads/2009/01/bitssettings.jpg" rel="lightbox[111]"><img class="alignright size-medium wp-image-113" title="BITS Settings" src="http://iboyd.net/wp-content/uploads/2009/01/bitssettings-300x209.jpg" alt="BITS Settings" width="300" height="209" /></a></p>
<p>First, check in ConfigMgr to see how BITS is configured for clients: <strong>Site Management -&gt; &lt;Site Code&gt; -&gt; Site Settings -&gt; Client Agents -&gt; Computer Client Agent -&gt; Right Click and select Properties. </strong>On the BITS tab, look at the throttling window and the transfer rates both inside and outside of the throttling window. If either is set below 500Kbps, your file transfers are going to be VERY slow at certain times. Depending on your network infrastructure and client roaming, set it to something reasonable. For testing, I set mine to 5000 Kbps during business hours.</p>
<p>But what if your settings seem reasonable or you applied the settings and it still doesn&#8217;t seem to work? As I mentioned above, clients don&#8217;t seem to apply these settings immediately. On a client, open up <strong>regedit</strong> and verify the settings. If they don&#8217;t match the ConfigMgr settings, try changing them, then restart the BITS service and watch your network bandwidth for a consistent spike in traffic that is, hopefully, your package. You may also have to re-run your advertisement.</p>
<p>Another possible culprit of misconfigured BITS are Active Directory Group Policy settings. Use <a href="http://msdn.microsoft.com/en-us/library/aa362844.aspx" target="_blank">this link</a> for more information about the BITS settings found in GPOs.</p>
<h2>On the Distribution Point</h2>
<p>With BITS, you have to remember that, in simple terms, you&#8217;re downloading files from an over-glorified website. That means that your file transfers are dependent on the IIS instance running on the distribution point. With that in mind, the main place to look for errors are the IIS logs. In Windows Server 2008, look in <strong><em>C:\inetpub\logs\LogFiles\W3SVC1</em></strong> for the newest log file. With BITS transfers, all of the file downloads get logged through IIS (by default, at least) just like regular web pages. In the logs you should see files and paths that match those contained in your failing software package. You will want to scan the log for culprit files, such as any file that produces a 404 error. Typically, the BITS transfer stops after only a few file download attempts when a 404 error is encountered. The culprit file will likely be towards the end of a large group of file requests.</p>
<p>If you find a 404 error in the logs,  look at the number after it. Is it 7 or 11? In this case you have a 404.7 or 404.11 error that is breaking your transfer to &#8220;BITS&#8221; (pun intended). This is caused by a filename or extension being blocked by IIS. Use this KB article for more details and for a workaround:  <a href="http://support.microsoft.com/kb/943891">http://support.microsoft.com/kb/943891 </a>. File extension filters can be changed by modifying the &lt;requestFiltering&gt; section in %windir%\System32\inetsrv\config\applicationHost.config. A restart of IIS may be required.</p>
<p>That&#8217;s all of my BITS troubleshooting tips for now. I will update this article if I find more troubleshooting tips that may be useful to the masses. Happy troubleshooting!</p>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2009/01/09/troubleshooting-sccm-and-bits-downloads/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Deploy Vista install.wim on any drive you like (as long as it&#8217;s D:\)</title>
		<link>http://iboyd.net/index.php/2008/12/03/deploy-vista-installwim-on-any-drive-you-like-as-long-as-its-d/</link>
		<comments>http://iboyd.net/index.php/2008/12/03/deploy-vista-installwim-on-any-drive-you-like-as-long-as-its-d/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 16:34:41 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[install.wim]]></category>
		<category><![CDATA[OS Volume]]></category>
		<category><![CDATA[OSD]]></category>
		<category><![CDATA[sccm]]></category>
		<category><![CDATA[vista]]></category>
		<category><![CDATA[wrong system drive]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=102</guid>
		<description><![CDATA[While designing and testing a deployment process for Windows Vista using System Center Configuration Manager 2007 I ran into a seemingly obscure problem: Vista refused to use drive letter C as the OS Volume and instead chose D as the system drive letter. The result is that the root of the system drive was D:\ [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_104" class="wp-caption alignright" style="width: 160px"><a href="http://iboyd.net/wp-content/uploads/2008/11/ballmer_peak1.png" rel="lightbox[102]"><img class="size-thumbnail wp-image-104" title="The Ballmer Peak" src="http://iboyd.net/wp-content/uploads/2008/11/ballmer_peak1-150x150.png" alt="Source: xkcd.com" width="150" height="150" /></a><p class="wp-caption-text">Source: xkcd.com</p></div>
<p>While designing and testing a deployment process for Windows Vista using <strong>System Center Configuration Manager 2007</strong> I ran into a seemingly obscure problem: Vista refused to use drive letter C as the OS Volume and instead chose D as the system drive letter. The result is that the root of the system drive was D:\ instead of C:\, which is something that legacy applications are not fond of.</p>
<p>This would seem like an easy problem to resolve. Surely, it is caused by the way the disk is partitioned or perhaps the drive letter that SCCM applies the image to is incorrect. Perhaps it&#8217;s a registry setting in the image file that needs to be modified offline. I experimented with all of these things, with no luck. Finally, I came across a <a title="Why does Vista end up on the D drive?" href="http://blogs.technet.com/inside_osd/archive/2007/08/08/why-does-vista-end-up-on-the-d-drive.aspx" target="_blank">technet blog entry</a> that I had missed with previous Google search queries:</p>
<blockquote><p><em>Several people have tried to use the install.wim from the Windows Vista installation media in an Install an existing image package task sequence.  <strong>They are surprised to discover that, upon completion, the operating system is on the D: drive instead of the C: drive. </strong> The short explanation for why this happens is that the operating system volume for the images in install.wim is D:.  In other words, when the image was captured, the reference machine had the operating system on volume D:.  Why this is the case for the install.wim that ships on the Windows Vista installation media is beyond the scope of this blog.</em></p></blockquote>
<p>So essentially, you can&#8217;t use the install.wim image from Vista in SCCM if you want to use C for the system drive letter. That would have been nice to know&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2008/12/03/deploy-vista-installwim-on-any-drive-you-like-as-long-as-its-d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Areca Backup</title>
		<link>http://iboyd.net/index.php/2008/11/24/areca-backup/</link>
		<comments>http://iboyd.net/index.php/2008/11/24/areca-backup/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 14:19:11 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[archiving]]></category>
		<category><![CDATA[areca]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=94</guid>
		<description><![CDATA[Some time ago, I devised a scheme for backing up my critical data that was both simplistic and inefficient. Every other morning at 4:00am I would create an image of my hard drive using DriveImageXML and then copy it to my NAS using the Windows Task Scheduler. This worked great for a while. However, as [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago, I devised a scheme for backing up my critical data that was both simplistic and inefficient. Every other morning at 4:00am I would create an image of my hard drive using <a title="DriveImage XML Website" href="http://www.runtime.org/driveimage-xml.htm" target="_blank">DriveImageXML</a> and then copy it to my NAS using the Windows Task Scheduler. This worked great for a while. However, as my hard drive contents grew it began to take too long to do these backups. Moving into an apartment that required me to use a wireless network was the final nail in the coffin and I finally discontinued this practice.<br />
<a href="http://iboyd.net/wp-content/uploads/2008/11/logical_view1.jpg" rel="lightbox[94]"><img class="alignleft size-thumbnail wp-image-95" title="Areca Backup" src="http://iboyd.net/wp-content/uploads/2008/11/logical_view1-150x150.jpg" alt="" width="150" height="150" /></a><br />
Since then, I have tried several different free backup solutions. None of them worked quite how I liked, for various reasons. Additionally, many of the ones that promised &#8220;set it and forget it&#8221; features rarely worked as advertised. In fact, after a month of using <a title="Ace Backup" href="http://www.acebackup.com/" target="_blank">AceBackup</a> I discovered my automated backups weren&#8217;t working for some reason. When a backup application has failed once, it&#8217;s hard to trust it again with such a critical task. I&#8217;ve heard a lot of great things about <a title="Jungle Disk Website" href="http://www.jungledisk.com/" target="_blank">Jungle Disk</a> but was reluctant to start paying monthly fees for a backup service that I ought to be able to handle myself.</p>
<p>Then, I stumbled upon the open source utility <a title="Areca Backup Website" href="http://areca.sourceforge.net/" target="_blank">Areca Backup</a> while looking for an acceptable backup solution for my work machine. Had I noticed at first that it was written in Java, I probably wouldn&#8217;t have tried it. However, I went ahead and installed it and I must say that this is the best backup utility that I have come across, at least for my needs.</p>
<p>Getting e-mails after backups is also a nice feature. Custom e-mail notifications can be set up for each backup. I setup mine to tell me in the subject of the e-mail if the backup was successful (1) or not (0). That way, I can filter successful backups that I don&#8217;t need to see to a reports folder while still getting the message when a backup fails.</p>
<p>The user interface of Areca Backup is surprisingly intuitive. I was able to create a compressed, encrypted, network-based backup with little trouble at all. There are several storage modes and backup types and backups are very fast. The coolest part about this software is the logical view screen. It allows the user to peek into their backups at files and restore any version of a file that they please. To recover, simply right click and select <strong>Recover&#8230;</strong> and then point to the folder where you want the recovered file(s) placed. Another incredibly useful feature is the ability to search within your archives for files.</p>
<p>The only part of this backup utility that seems half-baked to me is the scheduled backups feature. Areca does not run as a service (which can be good and bad) so it is up to the user to create a Windows Scheduled Task to automate archiving. Fortunately, the Areca has a feature that will automatically create the batch file with backup commands so that the user is only required to point their scheduled task to execute a file instead of manually entering the command line parameters. I can live with that.</p>
<p>Overall, this seems like a great open source project and I am impressed with how the software has worked so far. My plan is to start using this at home for backups both to my NAS and an offsite FTP/SSH server. Check it out.</p>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2008/11/24/areca-backup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Super Talent Pico Drive</title>
		<link>http://iboyd.net/index.php/2008/11/20/super-talent-pico-drive/</link>
		<comments>http://iboyd.net/index.php/2008/11/20/super-talent-pico-drive/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 18:16:21 +0000</pubDate>
		<dc:creator>Boyd</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Pico]]></category>
		<category><![CDATA[Super Talent]]></category>
		<category><![CDATA[USB Drive]]></category>
		<category><![CDATA[Vista Deployment]]></category>

		<guid isPermaLink="false">http://iboyd.net/?p=89</guid>
		<description><![CDATA[For deploying Windows XP to computers in our lab environment, we use 2GB 200x USB drives manufactured by Apacer. The reason for using these drives is simple: They are much faster and more reliable than DVD media. For Vista, we need to upgrade to 8GB drives (4GB would probably work for now, but having some [...]]]></description>
			<content:encoded><![CDATA[<p>For deploying Windows XP to computers in our lab environment, we use 2GB 200x USB drives manufactured by Apacer. The reason for using these drives is simple: They are much faster and more reliable than DVD media. For Vista, we need to upgrade to 8GB drives (4GB would probably work for now, but having some padding is nice). The 8GB version of thet Apacer drive is very expensive (some retailers have it listed at over $100). Since we will eventually need to buy a lot of 8GB drives, I decided to look for some chreaper alternatives that have similar performance. I came across the Super Talent Pico Drive, which has fairly good performance reviews when compared to the Apacer drive. At <a title="Amazon: Super Talent 8GB Pico Drive." href="http://www.amazon.com/Super-Talent-200X-Flash-Drive/dp/B001E8OMVU/ref=sr_1_2?ie=UTF8&amp;s=electronics&amp;qid=1226072738&amp;sr=1-2" target="_blank">$26</a>, it&#8217;s a bargain. I decided to order one for testing.<a href="http://iboyd.net/wp-content/uploads/2008/11/31qbxxngbkl_sl500_aa280_1.jpg" rel="lightbox[89]"><img class="alignright size-thumbnail wp-image-91" title="Super Talent Pico Drive 8GB" src="http://iboyd.net/wp-content/uploads/2008/11/31qbxxngbkl_sl500_aa280_1-150x150.jpg" alt="" width="150" height="150" /></a></p>
<p>I was shocked at how small this drive was. I would be reluctant to put most USB drives on my keyring because they are too bulky but this drive is really perfect accessory to your keys. The USB connector folds out of the casing. The one thing I dislike about the connector is that it allows you to put the key in to a USB slot backwards, so you have to pay attention when plugging it in.</p>
<p>In terms of performance, it is plenty fast for what we need. It is definitely faster than DVD media and may even have faster reads than the Apacer models we have used. If I have time someday I will do a side-by-side comparison. Writes to drive, while not blazing, are definitely fast enough for our needs since we only need to read data from the drive during our build process.</p>
<p>The verdict is still out for the sturdiness of this device. The USB connector is constructed of plastic that seems to scratch easily. I&#8217;m not sure if this will cause problems down the road. When the connector is folded into its case it seems to be fairly safe from unintentional damage.</p>
<p>Overall, I am really impressed with this USB drive. Having a USB drive with both gobs of space and great performance is spectacular, especially at this price. Super Talent has several other models that we may look at in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://iboyd.net/index.php/2008/11/20/super-talent-pico-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
