<?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>Maartendamen&#039;s blog &#187; Windows</title>
	<atom:link href="http://www.maartendamen.com/category/windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.maartendamen.com</link>
	<description>Blogging on various IT subjects</description>
	<lastBuildDate>Tue, 22 Nov 2011 21:27:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Disable hibernation on multiple Windows 2008 servers using Windows Powershell</title>
		<link>http://www.maartendamen.com/2011/02/disable-hibernation-on-multiple-windows-2008-servers-using-windows-powershell/</link>
		<comments>http://www.maartendamen.com/2011/02/disable-hibernation-on-multiple-windows-2008-servers-using-windows-powershell/#comments</comments>
		<pubDate>Mon, 21 Feb 2011 18:18:27 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[hibernation]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=613</guid>
		<description><![CDATA[By default hibernation is disabled on Windows 2008 server machines. However, a file called &#8220;hiberfil.sys&#8221; (equally sized to the amount of memory in the machine) is created in the root of the system volume. On a machine with 2GB of memory, this is not a big issue. However I discovered this on a VM with [...]]]></description>
			<content:encoded><![CDATA[<p>By default hibernation is disabled on Windows 2008 server machines. However, a file called &#8220;hiberfil.sys&#8221; (equally sized to the amount of memory in the machine) is created in the root of the system volume.<br />
On a machine with 2GB of memory, this is not a big issue. However I discovered this on a VM with 12GB of memory.. *auch*<br />
After some google&#8217;ing around I found out that there&#8217;s a way to get rid of this &#8220;hiberfil.sys&#8221;, the following Microsoft KB article gives you more information about this: <a href="http://support.microsoft.com/kb/920730/en-us">http://support.microsoft.com/kb/920730/en-us</a><br />
This command disables hibernation and also get&#8217;s rid of the hiberfil.sys file:<br />
<span id="more-613"></span></p>
<pre class="brush: plain; title: ; notranslate">
powercfg.exe /h off
</pre>
<p>But what if we wanted to repeat this task for let&#8217;s say 30-40 servers? Do it by hand? No way, Powershell to the rescue!<br />
Here&#8217;s the script I came up with, enjoy:</p>
<pre class="brush: powershell; title: ; notranslate">
# Ask for credentials used to do remote WMI.
$cred    	= Get-Credential DOMAIN\account

# Filter used for active directory query. Only 2008 server machines.
$strFilter 	= &quot;(&amp;(objectClass=computer)(operatingSystem=Windows *2008*))&quot;

$objDomain 	= New-Object System.DirectoryServices.DirectoryEntry
$objSearcher = New-Object System.DirectoryServices.DirectorySearcher
$objSearcher.SearchRoot = $objDomain
$objSearcher.Filter = $strFilter
$objSearcher.SearchScope = &quot;Subtree&quot;

$colResults = $objSearcher.FindAll()

# Loop through list of servers.
foreach ($objResult in $colresults)
{
	$objItem = $objResult.Properties
	$name = $objItem.name[0]

	Write-Host &quot;Disabling hibernation on: $name&quot;

	try {
		invoke-wmimethod -cred $cred -path win32_process -name create -argumentlist &quot;powercfg.exe /h off&quot; -ComputerName $name
	}
	catch {
		Write-Host &quot;Failed to disable hibernation on: $name, no permission or server down?&quot;
		break
	}
	finally {
		Write-Host &quot;Hibernation disabled on: $name&quot;
	}
}
</pre>
<p>Onwards!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2011/02/disable-hibernation-on-multiple-windows-2008-servers-using-windows-powershell/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The case of the black Windows startup screen</title>
		<link>http://www.maartendamen.com/2010/06/the-case-of-the-black-windows-startup-screen/</link>
		<comments>http://www.maartendamen.com/2010/06/the-case-of-the-black-windows-startup-screen/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 14:40:02 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[Windows]]></category>
		<category><![CDATA[2003]]></category>
		<category><![CDATA[microsoft]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=313</guid>
		<description><![CDATA[Today I had a nice issue. One of the servers at work suddenly had a &#8220;black&#8221; Windows startup screen. It looked like this: This happened after the server (suddenly) ran out of free disk space. It turned out that all color settings where reset to &#8220;0&#8243; (black), the registry showed the following color values: The [...]]]></description>
			<content:encoded><![CDATA[<p>Today I had a nice issue. One of the servers at work suddenly had a &#8220;black&#8221; Windows startup screen.<br />
It looked like this:<br />
<a href="http://www.maartendamen.com/wp-content/uploads/2010/06/black1.png"><img src="http://www.maartendamen.com/wp-content/uploads/2010/06/black1-300x180.png" alt="" title="black1" width="300" height="180" class="alignnone size-medium wp-image-314" /></a><br />
<span id="more-313"></span></p>
<p>This happened after the server (suddenly) ran out of free disk space. It turned out that all color settings where reset to &#8220;0&#8243; (black), the registry showed the following color values:</p>
<p><a href="http://www.maartendamen.com/wp-content/uploads/2010/06/black2.png"><img src="http://www.maartendamen.com/wp-content/uploads/2010/06/black2.png" alt="" title="black2" width="407" height="577" class="alignnone size-full wp-image-315" /></a></p>
<p>The fix for this was easy, I took the color schema settings from a working 2003 server and inserted them remotely from my workstation. The color schema settings are located under the following registry key: HKEY_USERS\.DEFAULT\Control Panel\Colors</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2010/06/the-case-of-the-black-windows-startup-screen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Extending Windows 2003 os disk using diskpart and VMware</title>
		<link>http://www.maartendamen.com/2010/03/extending-windows-2003-os-disk-using-diskpart-and-vmware/</link>
		<comments>http://www.maartendamen.com/2010/03/extending-windows-2003-os-disk-using-diskpart-and-vmware/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 20:07:58 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[VMware vSphere]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[disk]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[vmware]]></category>
		<category><![CDATA[vsphere]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=216</guid>
		<description><![CDATA[I use this trick quite often for Windows 2003 machines (this is not needed on Windows 2008 machines, you can use diskpart directly here!) After time the OS disk grows out it&#8217;s free space, usually this happens due to Windows updates or logfiles. So, here&#8217;s how to extend an OS disk of a Windows 2003 [...]]]></description>
			<content:encoded><![CDATA[<p>I use this trick quite often for Windows 2003 machines (this is not needed on Windows 2008 machines, you can use diskpart directly here!)<br />
After time the OS disk grows out it&#8217;s free space, usually this happens due to Windows updates or logfiles.<br />
So, here&#8217;s how to extend an OS disk of a Windows 2003 machine using diskpart and VMware (ESX 2.0, vSphere, ESX3.5 anything will do):</p>
<p><span id="more-216"></span></p>
<ol>
<li>Shut down the virtual machine in question.</li>
<li>Connect the virtual machine OS disk to another virtual machine, this can be a running virtual machine (please note that you do need to reboot this machine after you are done):- Click edit settings on the running virtual machine.- Click on &#8220;Add&#8230;&#8221; to add hardware to the machine.<br />
- Select &#8220;Hard disk&#8221;<br />
- Select &#8220;Use an existing virtual disk&#8221;<br />
- Browse to the virtual disk.<br />
- Click &#8220;Next&#8221; and &#8220;Finish&#8221;</p>
<p>Your running virtual machine should now look like this:</p>
<p><img class="alignnone size-full wp-image-220" title="10-3-2010 20-44-19" src="http://www.maartendamen.com/wp-content/uploads/2010/03/10-3-2010-20-44-19.png" alt="10-3-2010 20-44-19" width="373" height="321" /></p>
<p>Click &#8220;OK&#8221; to apply the settings.</li>
<li>Now go to edit settings again, and change the size of the virtual disk.
<p><img class="alignnone size-full wp-image-221" title="10-3-2010 20-55-36" src="http://www.maartendamen.com/wp-content/uploads/2010/03/10-3-2010-20-55-36.png" alt="10-3-2010 20-55-36" width="317" height="99" />Click &#8220;OK&#8221; once again.</li>
<li>Now open the console of the running machine. And start a command prompt.</li>
<li>Type &#8220;diskpart&#8221;.Within diskpart, type &#8220;list disk&#8221; to display available disks, you should notice the disk with the free space:
<p><img class="alignnone size-full wp-image-222" title="10-3-2010 20-58-31" src="http://www.maartendamen.com/wp-content/uploads/2010/03/10-3-2010-20-58-31.png" alt="10-3-2010 20-58-31" width="439" height="95" /></p>
<p>Now select that disk, using &#8220;select disk 2&#8243; (2 being the disk number offcourse..)<br />
After that, select the appropriate partition, using &#8220;select part 1&#8243; (1 being the partition number)<br />
<img class="alignnone size-full wp-image-223" title="10-3-2010 21-01-03" src="http://www.maartendamen.com/wp-content/uploads/2010/03/10-3-2010-21-01-03.png" alt="10-3-2010 21-01-03" width="439" height="138" /></p>
<p>Now extend the partition using the &#8220;extend&#8221; command.</p>
<p><img class="alignnone size-full wp-image-224" title="10-3-2010 21-02-46" src="http://www.maartendamen.com/wp-content/uploads/2010/03/10-3-2010-21-02-46.png" alt="10-3-2010 21-02-46" width="351" height="73" /></p>
<p>Hooray! :-)</li>
<li>Now shut down the virtual machine, and remove the added disk. After that you can power on the initial virtual machine.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2010/03/extending-windows-2003-os-disk-using-diskpart-and-vmware/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

