<?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/tag/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>Installing HouseAgent on Windows</title>
		<link>http://www.maartendamen.com/2011/07/installing-houseagent-on-windows/</link>
		<comments>http://www.maartendamen.com/2011/07/installing-houseagent-on-windows/#comments</comments>
		<pubDate>Tue, 12 Jul 2011 18:05:23 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[HouseAgent]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[domotica]]></category>
		<category><![CDATA[erlang]]></category>
		<category><![CDATA[housagent]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[rabbitmq]]></category>
		<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=886</guid>
		<description><![CDATA[It has been two weeks ago since I released the first (private) beta version of HouseAgent. A handful of people starting testing and playing with it, and I noticed that documentation and instructions are lacking a bit. In this blog post I will guide you through the process (in very basic steps) of installing the [...]]]></description>
			<content:encoded><![CDATA[<p>It has been two weeks ago since I released the first (private) beta version of HouseAgent. A handful of people starting testing and playing with it, and I noticed that documentation and instructions are lacking a bit.<br />
In this blog post I will guide you through the process (in very basic steps) of installing the core of HouseAgent. The good news is, that this will get core of HouseAgent up and running. The bad news is that you can&#8217;t do anything with, not without plug-ins at least. I will dive into the subject of installing plug-ins in another blog post.</p>
<p><strong>Step 1: installation of RabbitMQ (and Erlang)</strong></p>
<p>RabbitMQ is the message broker required by HouseAgent, you can download it from <a href="http://www.rabbitmq.com/server.html">here</a>.<br />
You need the server with Windows installer:</p>
<p><a href="http://www.maartendamen.com/2011/07/installing-houseagent-on-windows/download_rabbitmq/" rel="attachment wp-att-889"><img src="http://www.maartendamen.com/wp-content/uploads/2011/07/download_rabbitmq-620x277.png" alt="" title="download_rabbitmq" width="620" height="277" class="aligncenter size-medium wp-image-889" /></a></p>
<p>After you have started the RabbitMQ setup, it will alert you that you also need Erlang:<br />
<span id="more-886"></span><br />
<a href="http://www.maartendamen.com/2011/07/installing-houseagent-on-windows/erlang/" rel="attachment wp-att-897"><img src="http://www.maartendamen.com/wp-content/uploads/2011/07/erlang.png" alt="" title="erlang" width="492" height="176" class="size-full wp-image-897" /></a></p>
<p>Go ahead and download and install the latest Erlang version, choose the Windows binary form:</p>
<p><a href="http://www.maartendamen.com/2011/07/installing-houseagent-on-windows/erlang2/" rel="attachment wp-att-898"><img src="http://www.maartendamen.com/wp-content/uploads/2011/07/erlang2.png" alt="" title="erlang2" width="331" height="193" class="size-full wp-image-898" /></a></p>
<p>Now complete the installation of both Erlang and RabbitMQ, the default settings will suffice.<br />
<strong><br />
Step 2: Installation of HouseAgent</strong></p>
<p>Download the latest beta release from the HouseAgent forum. And start the HouseAgent installation.<br />
It&#8217;s an easy next->next->finish installation.</p>
<p><strong>Step 3: Enjoy HouseAgent<br />
</strong><br />
Congratulations! You should now be ready to use HouseAgent!<br />
There&#8217;s a HouseAgent start menu group in the start menu to get you going.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2011/07/installing-houseagent-on-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Introducing HouseAgent</title>
		<link>http://www.maartendamen.com/2011/06/introducing-houseagent/</link>
		<comments>http://www.maartendamen.com/2011/06/introducing-houseagent/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 20:08:03 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[HouseAgent]]></category>
		<category><![CDATA[amqp]]></category>
		<category><![CDATA[Home automation]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mako]]></category>
		<category><![CDATA[multi-platform]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[rabbitmq]]></category>
		<category><![CDATA[rrd]]></category>
		<category><![CDATA[twisted]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[z-wave]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=784</guid>
		<description><![CDATA[HouseAgent is a multi platform, open source home automation application. That was the short introduction of something I have been working on for quite some months already. HouseAgent has been running as my own home automation software for some time. I hear you asking, why not use one of the standard software products available? There [...]]]></description>
			<content:encoded><![CDATA[<p><em>HouseAgent is a multi platform, open source home automation application.</em></p>
<p><a href="http://www.maartendamen.com/2011/06/introducing-houseagent/houseagent1-2/" rel="attachment wp-att-794"><img src="http://www.maartendamen.com/wp-content/uploads/2011/06/houseagent11-620x325.png" alt="" title="HouseAgent main" width="620" height="325" class="alignnone size-medium wp-image-794" /></a></p>
<p>That was the short introduction of something I have been working on for quite some months already. HouseAgent has been running as my own home automation software for some time.<br />
I hear you asking, why not use one of the standard software products available? There are a couple of reasons for that:<br />
<span id="more-784"></span></p>
<ul>
<li>Most software is expensive, for a full set-up €500,- is no exception;</li>
<li>I wanted to learn from my home automation hobby, by writing my own software I got and still get a lot of insight on new frameworks/protocols/techniques etc;</li>
<li>Really, I wanted free home automation software to be available to others out there as well!</li>
<li>Most software out there is not designed to run on a low power/low profile systems. HouseAgent can be run on low power system without hassle.</li>
<li>Also most software only runs on one platform i.e. Windows or Linux. I believe in a truly open platform where all kinds of developers can contribute.</li>
</ul>
<p>Let&#8217;s look at some core components used in HouseAgent:</p>
<p><strong>AMQP/RabbitMQ</strong><br />
One of the core components used in HouseAgent is AMQP. The Advanced Message Queuing Protocol (AMQP) is an open standard application layer protocol for message-oriented middleware. The defining features of AMQP are message orientation, queuing, routing (including point-to-point and publish-and-subscribe), reliability and security.<br />
AMQP is used within HouseAgent for plugin communication. Here is a picture, which hopefully explains all the bits and pieces a bit better:</p>
<p><a href="http://www.maartendamen.com/2011/06/introducing-houseagent/houseagent_arch/" rel="attachment wp-att-807"><img src="http://www.maartendamen.com/wp-content/uploads/2011/06/houseagent_arch.png" alt="" title="houseagent_arch" width="408" height="299" class="aligncenter size-full wp-image-807" /></a></p>
<p>As you can see all plug-ins are separate isolated components, in fact the plug-ins don&#8217;t even know about the coordinator or each other. The coordinator is the main HouseAgent application which runs important features such as the event handler and the web-based GUI. A plug-in communicates with the broker, and the message protocol used for this is AMQP.<br />
Certain types of messages are &#8220;published&#8221; on the broker, for example a device_value_update message might be send to the broker by a plug-in. The coordinator is &#8220;subscribed&#8221; to such messages and handles them appropriately (i.e. run a certain action based upon an event or save history to a history file)<br />
The coordinator on it&#8217;s turn can publish messages to the broker as well, commanding the plug-ins to do certain action. One example would be the power_on message. This message commands a certain plug-in to turn on a device with a certain address. </p>
<p>So what&#8217;s RabbitMQ? RabbitMQ is a broker which implements AMQP, there are several other AMQP implementations which might work as well with HouseAgent (not tested!). You can read more about AMQP on it&#8217;s <a href="http://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol">wikipedia page</a>. You can read more about RabbitMQ on it&#8217;s <a href="http://www.rabbitmq.com/">homepage</a>.</p>
<p><strong>Twisted (Matrix)</strong><br />
Twisted is used for serial communication and all networking communication in HouseAgent. Twisted is a networking engine written in Python, supporting numerous protocols. It contains a web server, numerous chat clients, chat servers, mail servers, and more. The main difference between Twisted and other networking engine&#8217;s is that Twisted is asynchronous. You can read about the differences between synchronous and asynchronous communication <a href="http://en.wikipedia.org/wiki/Comparison_of_synchronous_and_asynchronous_signalling">here</a>. Twisted certainly was an eye opener for (thanks Rene) but also required a completely different way of thinking about networking and communication in general.</p>
<p>Among these core components some other frameworks/packages are used:</p>
<ul>
<li>Mako Template (for web page templating)</li>
<li>PyRRD (for historic graphing)</li>
<li>py-serial (serial communication)</li>
<li>pywin32 (Windows only)</li>
</ul>
<p>Although the development of HouseAgent is just getting started, it already includes some nice features. Some core functionality HouseAgent offers right now:</p>
<ul>
<li>Storing and logging of device values</li>
<li>Graphing (based upon RRDtool)</li>
<li>Event handling (triggers include: time based, device value changes)</li>
<li>Flexible plug-in development and easy extension</li>
</ul>
<p>This concludes the short introduction of HouseAgent. In future blog posts I will dive deeper in different aspects of HouseAgent.<br />
Right now a group of beta testers has been selected, I will send out a first beta version a.s.a.p. after that a public version will come available.<br />
As of today the source code is available for the core of HouseAgent! You can review the source code, and watch the development progress on <a href="https://github.com/maartendamen/HouseAgent">Github</a>. But please don&#8217;t expect a complete system out that source code, stand-by for binary releases.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2011/06/introducing-houseagent/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<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>Mass creation of HP WSEM WiFi guest accounts using SSH and PowerShell</title>
		<link>http://www.maartendamen.com/2010/07/mass-creation-of-hp-wsem-wifi-guest-accounts-using-ssh-and-powershell/</link>
		<comments>http://www.maartendamen.com/2010/07/mass-creation-of-hp-wsem-wifi-guest-accounts-using-ssh-and-powershell/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 13:58:51 +0000</pubDate>
		<dc:creator>Maarten</dc:creator>
				<category><![CDATA[Powershell]]></category>
		<category><![CDATA[hp]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[Windows]]></category>
		<category><![CDATA[wireless]]></category>
		<category><![CDATA[wsem]]></category>

		<guid isPermaLink="false">http://www.maartendamen.com/?p=348</guid>
		<description><![CDATA[I was asked to create 365 (1 year) of WiFi (daily) guest access accounts, and export them to CSV. Of course I didn&#8217;t want to create them by hand.. this is where PowerShell came in. I used the following PowerShell script to create random WiFi guest accounts: Special thanks to Joel Bennett&#8217;s SharpSSH wrapper for [...]]]></description>
			<content:encoded><![CDATA[<p>I was asked to create 365 (1 year) of WiFi (daily) guest access accounts, and export them to CSV.<br />
Of course I didn&#8217;t want to create them by hand.. this is where PowerShell came in. I used the following PowerShell script to create random WiFi guest accounts:</p>
<p><span id="more-348"></span></p>
<pre class="brush: powershell; title: ; notranslate">
# Number of days to generate, default = 365
$NumDays 		= 365
$AccessGroup 	= &quot;Gasten&quot;
$ExpiryTime 	= &quot;20:00&quot;
$StartTime 		= &quot;07:00&quot;
$OutputCSV		= &quot;C:\TEMP\wireless.csv&quot;

$SshHost 		= &quot;127.0.0.1&quot;
$SshUser		= &quot;someuser&quot;

$access_codes = @()

# Start SSH session
New-SshSession $SshUser $SshHost
Invoke-Ssh &quot;z&quot;
Invoke-Ssh &quot;conf t&quot;
Invoke-Ssh &quot;wireless F&quot;
Invoke-Ssh &quot;conf t&quot;
Invoke-Ssh &quot;radius-server local&quot;

$i = 0;
do {
	# WSEM format: mm/dd/yyyy hh:mm
	$date = (Get-Date).AddDays($i)
	$date2 = Get-Date $date -Format &quot;dd-MM-yyyy&quot;
	$date = Get-Date $date -format &quot;MM:dd:yyyy&quot;
	$pass = RandomPassword 4
	$user = RandomPassword 4
	$output = &quot;rad-user $user password 0 $pass group $AccessGroup guest expiry-time $ExpiryTime expiry-date $date start-time $StartTime start-date $date&quot;

	# add user through SSH
	Invoke-ssh $output

	$Response = New-Object PSObject
	Add-Member -InputObject $Response -MemberType NoteProperty -Name &quot;Datum&quot; -Value $date2
	Add-Member -InputObject $Response -MemberType NoteProperty -Name &quot;Gebruikersnaam&quot; -Value $user
	Add-Member -InputObject $Response -MemberType NoteProperty -Name &quot;Wachtwoord&quot; -Value $pass
	$access_codes += $Response

	$i++;
} while ( $i -le $NumDays )

# Save and disconnect SSH
Invoke-ssh &quot;write mem&quot;
Remove-SshSession

# Export to CSV
$access_codes | Export-Csv $OutputCSV

# Helper functions
function RandomPassword ([int]$intPasswordLength)
{
   $strNumbers = &quot;1234567890&quot;
   $strCapitalLetters = &quot;ABCDEFGHIJKLMNOPQRSTUVWXYZ&quot;
   $strLowerLetters = &quot;abcdefghijklmnopqrstuvwxyz&quot;
   $rand = new-object random

   for ($a=1; $a -le $intPasswordLength; $a++)
      {
         if ($a -gt 3)
           {
      	      $b = $rand.next(0,3) + $a
      	      $b = $b % 3 + 1
      	   } else { $b = $a }
      	 switch ($b)
      	   {
      	      &quot;1&quot; {$b = &quot;$strNumbers&quot;}
      	      &quot;2&quot; {$b = &quot;$strCapitalLetters&quot;}
      	      &quot;3&quot; {$b = &quot;$strLowerLetters&quot;}
      	   }
         $charset = $($b)
         $number = $rand.next(0,$charset.Length)
         $RandomPassword += $charset[$number]
      }
   return $RandomPassword
}
</pre>
<p>Special thanks to Joel Bennett&#8217;s SharpSSH wrapper for PowerShell (located here: <a href="http://huddledmasses.org/scriptable-ssh-from-powershell/">http://huddledmasses.org/scriptable-ssh-from-powershell/</a>) which I used to automate the command line commands for the HP WSEM.<br />
This shows the great power of PowerShell for automating virtually anything! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.maartendamen.com/2010/07/mass-creation-of-hp-wsem-wifi-guest-accounts-using-ssh-and-powershell/feed/</wfw:commentRss>
		<slash:comments>4</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>
	</channel>
</rss>

