<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Green IT</title>
        <link>http://blogs.imeta.co.uk/nrees/category/153.aspx</link>
        <description>Green IT</description>
        <language>en-GB</language>
        <copyright>Neil Rees</copyright>
        <generator>Subtext Version 2.1.1.1</generator>
        <item>
            <title>Unexpected Power Savings Through New PSU</title>
            <link>http://blogs.imeta.co.uk/nrees/archive/2009/10/15/unexpected-power-savings-through-new-psu.aspx</link>
            <description>&lt;p&gt; &lt;/p&gt;  &lt;p&gt;It’s been a long time since I’ve had the opportunity to geek with a bit of new hardware, and this didn’t really look like this was going to provide much of an opportunity at first.  The back story is that the power supply in the Media Center has been breaking down slowly and emitting a nasty whistling noise which has been driving me up the wall, let alone anyone with more acute hearing than me.&lt;/p&gt;  &lt;p&gt;I set about hunting down a quiet power supply to replace it with, one that didn’t whistle and didn’t emit a huge amount of fan noise.  I settled on the &lt;a href="http://www.arctic-cooling.com/catalog/product_info.php?cPath=38_&amp;amp;mID=122"&gt;Arctic Cooling Fusion 550R&lt;/a&gt; as it promises silent operation and has an airflow path compatible with the narrow HTPC case that I’m using.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/image_2.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/image_thumb.png" width="244" height="171" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Now the thing that caught my attention and is the real reason that I’m writing this is that it claims to be high efficiency energy saving unit.  Now normally I ignore the bold claims made on packaging, however this one has piqued my curiosity and was worthy of experiment.&lt;/p&gt;  &lt;p&gt;The web site says:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;strong&gt;High Efficiency = Less Power Loss = Quiet Cooling       &lt;br /&gt;&lt;/strong&gt;With an efficiency of at least 82 to 86%, less heat is generated inside the PSU. As a result of this a single 80-mm-fan is enough to cool the PSU. The rubber-mounted fan is spinning in a range between 700 and 2000 RPM making it virtually silent. Additionally to this the PSU comes along with two external fan-connectors giving the possibility to control the case ventilation based on load and temperature and thus lowers the noise level of the complete system to an absolute minimum. &lt;/p&gt;    &lt;p&gt;&lt;strong&gt;Effective energy-use preserves nature and saves money&lt;/strong&gt;  &lt;br /&gt;By making appreciated use of natural resources, especially energy you can contribute to lower CO2-Emissions. Additionally you save electricity cost of about 100 €, so the Fusion 550R is a true Payment Saving Unit*. &lt;/p&gt;    &lt;p&gt;&lt;em&gt;* In 4 years, 200 d/y with 4 h/d full load at 0,15€/kWh&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Ok, understood.  I used my power meter to measure the power the Media Center uses using it’s old power supply (an old Q-Technology 400W unit, circa ~2003).&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_083_4.jpg" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IMAGE_083" border="0" alt="IMAGE_083" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_083_thumb_1.jpg" width="189" height="204" /&gt;&lt;/a&gt; &lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_084_2.jpg" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IMAGE_084" border="0" alt="IMAGE_084" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_084_thumb.jpg" width="191" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;87.8W at idle at desktop, and 5.1W when off.  This stunned me, that’s not on standby, that’s 5W been consumed when OFF – proper off.  I’m amazed at the &lt;a href="http://en.wikipedia.org/wiki/Standby_power"&gt;phantom load&lt;/a&gt; that a switched off PC creates, I’ll not mock my Grandmother for switching her electronics of at the mains overnight ever again!&lt;/p&gt;  &lt;p&gt;I swapped out the QTechnology PSU with the new Arctic Cooling PSU, and repeated the test:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_086_2.jpg" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IMAGE_086" border="0" alt="IMAGE_086" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_086_thumb.jpg" width="198" height="204" /&gt;&lt;/a&gt; &lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_087_2.jpg" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="IMAGE_087" border="0" alt="IMAGE_087" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/UnexpectedPowerSavingsThroughNewPSU_12B25/IMAGE_087_thumb.jpg" width="220" height="204" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Well I’ll be damned.  Not that I doubted the advertising you understand.&lt;/p&gt;  &lt;p&gt;Let’s verify their maths.  4 years, 200 days/year with 4 hours/day.  So that’s a 4 x 200 x 4 = 3,200 hours of operation during the four year sample.  Based on my readings I’m saving 22.9W, which means I’ll save 1KWh every 43.6 hours of operation.  So, 3200 / 43.6 = 73.3 KWh saved.&lt;/p&gt;  &lt;p&gt;And 73.3 KWh costs the princely sum of £8.80 (at £0.12/KWh).  So I’m not sure about the €100 claim that they make, however I’m happy - the unit is silent in operation which was the goal, I’m using at least 25% less power (without changing any other components!) which can’t be bad, and it’ll pay for a takeaway curry over the course of it’s life.&lt;/p&gt;  &lt;p&gt;Nice.&lt;/p&gt;&lt;img src="http://blogs.imeta.co.uk/nrees/aggbug/788.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Neil Rees</dc:creator>
            <guid>http://blogs.imeta.co.uk/nrees/archive/2009/10/15/unexpected-power-savings-through-new-psu.aspx</guid>
            <pubDate>Thu, 15 Oct 2009 20:16:05 GMT</pubDate>
            <wfw:comment>http://blogs.imeta.co.uk/nrees/comments/788.aspx</wfw:comment>
            <comments>http://blogs.imeta.co.uk/nrees/archive/2009/10/15/unexpected-power-savings-through-new-psu.aspx#feedback</comments>
            <wfw:commentRss>http://blogs.imeta.co.uk/nrees/comments/commentRss/788.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.imeta.co.uk/nrees/services/trackbacks/788.aspx</trackback:ping>
        </item>
        <item>
            <title>An ASP.NET Wake-On-LAN Application</title>
            <link>http://blogs.imeta.co.uk/nrees/archive/2008/11/26/an-asp.net-wake-on-lan-application.aspx</link>
            <description>&lt;p&gt;Since writing some time ago about how you would in theory go about creating a web site that could &lt;a href="http://blogs.imeta.co.uk/nrees/archive/2008/08/04/315.aspx"&gt;remotely wake up PCs&lt;/a&gt; that have gone to standby to conserve power it has generated a lot of interest.&lt;/p&gt;  &lt;p&gt;If you're interested in deploying a system like this in your organisation, or at home, the source to this system is available below.  Here's what you'll need to deploy it.&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;1.  You need to identify a suitable server for this, it needs to be either Windows XP, Vista or Server 2003 or 2008.  It also must have IIS installed, .net 2.0 or higher, have ASP.NET enabled, and have SQL 2005 Express Edition installed.&lt;/p&gt;  &lt;p&gt;2.  Download the application from &lt;a href="http://www.neilrees.net/downloads/WOL/wakeonlan.zip"&gt;here&lt;/a&gt; and extract it into it's own folder.  In this case I've extracted it into c:\inetpub\WOL&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/AnASP.NETWakeOnLANApplication_CA87/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="237" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/AnASP.NETWakeOnLANApplication_CA87/image_thumb.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;3.  I'll create a standalone web site for the application - there's no reason why it couldn't exist as a virtual directory underneath another app, but you may have to tweak the web.config slightly in that scenario.  Launch IIS Manager (I'm using Vista), Click Sites then Add Web Site.  Give the site a name, point the directory at the location we just unzipped the solution into and choose a port to listen on (I'm using 8080):&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/AnASP.NETWakeOnLANApplication_CA87/image_4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="391" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/AnASP.NETWakeOnLANApplication_CA87/image_thumb_1.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;4. Click ok, and it should be that easy.  In practice you'll need to make sure that the user the application is running as has read/write access to the database files in the App_Data folder.  You then just need to point a browser at it:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/AnASP.NETWakeOnLANApplication_CA87/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="248" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/AnASP.NETWakeOnLANApplication_CA87/image_thumb_2.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;Then configure all your workstation to sleep after 20 mins of inactivity and you'll be able to sleep at night safe in the knowledge you are burning much less electricity, and also saving money!&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;The binary distribution can be downloaded &lt;a href="http://www.neilrees.net/downloads/wol/wakeonlan.zip"&gt;here&lt;/a&gt; (200kb)&lt;/p&gt;  &lt;p&gt;You can download the full source from &lt;a href="http://www.neilrees.net/downloads/WOL/wakeonlansource.zip"&gt;here&lt;/a&gt; (200kb)&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;  &lt;p&gt;UPDATE: The project is now up on &lt;a href="http://www.codeplex.com/WOL"&gt;Codeplex&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.imeta.co.uk/nrees/aggbug/519.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Neil Rees</dc:creator>
            <guid>http://blogs.imeta.co.uk/nrees/archive/2008/11/26/an-asp.net-wake-on-lan-application.aspx</guid>
            <pubDate>Wed, 26 Nov 2008 09:45:31 GMT</pubDate>
            <wfw:comment>http://blogs.imeta.co.uk/nrees/comments/519.aspx</wfw:comment>
            <comments>http://blogs.imeta.co.uk/nrees/archive/2008/11/26/an-asp.net-wake-on-lan-application.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.imeta.co.uk/nrees/comments/commentRss/519.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.imeta.co.uk/nrees/services/trackbacks/519.aspx</trackback:ping>
        </item>
        <item>
            <title>Staying awake - Turning your PC into an Insomniac</title>
            <link>http://blogs.imeta.co.uk/nrees/archive/2008/09/02/348.aspx</link>
            <description>&lt;p&gt;&lt;strong&gt;Controlling Power Management and preventing standby from C#&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Following on from last time &lt;a href="http://blogs.imeta.co.uk/nrees/archive/2008/08/04/315.aspx"&gt;Going slightly green - Wake on LAN from ASP.NET&lt;/a&gt; I and a few other people have come across another problem which only occurs occasionally, but when it does is rather irritating.  For example, I have a need to calculate Pi to several thousand decimal places (I can't imagine why this would ever be the case) - it's going to take my Pi generator a few hours to work it out, so I kick it off when I go home confident in the knowledge that it'll be done by the morning.  In the morning I discover my PC has conscientiously  gone to sleep and my process is only twenty minutes closer to it's goal, which is a shame as I need my Pi.  I could have turned the power management off, but I know that I'll forget to enable it again, so that falls into my category of "Bad Things" to do.&lt;/p&gt;  &lt;p&gt;I need something like Presentation Mode, however with a timeout.  As far as I can tell such as thing doesn't exist, so I've made one.&lt;/p&gt;  &lt;p&gt;The power management functions in kernel32.dll contain a function called &lt;a href="http://msdn.microsoft.com/en-us/library/aa373208.aspx"&gt;SetThreadExecutionState&lt;/a&gt; which allows an application to inform the system that it is in use, thereby preventing the system from entering sleep or turning off the display while the application is running.  I need a simple little application that will tell the system not to go to sleep, and then tell it it's OK again some period of time later.&lt;/p&gt;  &lt;p&gt;First off I need wrap up the native call in a managed wrapper:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;[DllImport(&lt;span style="color: #006080"&gt;"kernel32.dll"&lt;/span&gt;, CharSet = CharSet.Auto, SetLastError = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)]
&lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;extern&lt;/span&gt; EXECUTION_STATE SetThreadExecutionState(EXECUTION_STATE flags);

[Flags]
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;enum&lt;/span&gt; EXECUTION_STATE : &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt;
{
    ES_SYSTEM_REQUIRED = 0x00000001,
    ES_DISPLAY_REQUIRED = 0x00000002,
    ES_CONTINUOUS = 0x80000000
}

&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; PreventSleep()
{
    SetThreadExecutionState(EXECUTION_STATE.ES_SYSTEM_REQUIRED | EXECUTION_STATE.ES_CONTINUOUS);
}

&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; AllowSleep()
{
    SetThreadExecutionState(EXECUTION_STATE.ES_CONTINUOUS);
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;I also need a little form to allow me to tell the PC to stay awake, it need not be complicated - just a form and a notification icon to let me access it, and some timers to wait.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="126" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_thumb.png" width="244" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;When the I click the OK button I can tell Windows to not go to sleep and also start a timer such that when it ticks enables power management again:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; btnOK_Click(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; duration;

    &lt;span style="color: #008000"&gt;// check that we have a a number entered by the user&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;.TryParse(comboBox1.Text, &lt;span style="color: #0000ff"&gt;out&lt;/span&gt; duration) == &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;)
    {
        MessageBox.Show(&lt;span style="color: #006080"&gt;"Numbers only please"&lt;/span&gt;, &lt;span style="color: #006080"&gt;"Validation failed"&lt;/span&gt;);
        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt;;
    }

    &lt;span style="color: #008000"&gt;// keep the system awake for many hours&lt;/span&gt;
    Insomnia.PreventSleep();
  
    stayAwake.Interval = (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)&lt;span style="color: #0000ff"&gt;new&lt;/span&gt; TimeSpan(duration, 0, 0).TotalMilliseconds;
    stayAwake.Enabled = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;

    &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Hide();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;When the stayAwake timer goes off it has waited for the desired amount of time and we can turn power management on again:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; timer1_Tick(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, EventArgs e)
{
    stayAwake.Enabled = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;
    Insomnia.AllowSleep();
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;The only other thing we need to do is to make the notification icon let me know what's going and what mode the PC is in at any point in time:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="145" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_thumb_1.png" width="404" border="0" /&gt;&lt;/a&gt;  followed later by &lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_6.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="139" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_thumb_2.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And as I'm likely forget when I have a job running and it's home time, I'll get the other timer to nag me just before I leave to go home:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="117" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/StayingawakeTurningyourPCintoanInsomniac_BC68/image_thumb_3.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;I'm happy with that. If it looks useful to you too you can &lt;a href="http://neilrees.net/downloads/insomniac/publish.htm"&gt;install it&lt;/a&gt; using clickonce, or &lt;a href="http://neilrees.net/downloads/insomniac/insomniac.zip"&gt;download the source&lt;/a&gt; if you prefer.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Enjoy, it comes with &lt;a href="about:blank"&gt;my usual warranty&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://blogs.imeta.co.uk/nrees/aggbug/348.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Neil Rees</dc:creator>
            <guid>http://blogs.imeta.co.uk/nrees/archive/2008/09/02/348.aspx</guid>
            <pubDate>Tue, 02 Sep 2008 12:47:33 GMT</pubDate>
            <wfw:comment>http://blogs.imeta.co.uk/nrees/comments/348.aspx</wfw:comment>
            <comments>http://blogs.imeta.co.uk/nrees/archive/2008/09/02/348.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://blogs.imeta.co.uk/nrees/comments/commentRss/348.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.imeta.co.uk/nrees/services/trackbacks/348.aspx</trackback:ping>
        </item>
        <item>
            <title>Going slightly green - Wake on LAN from ASP.NET</title>
            <link>http://blogs.imeta.co.uk/nrees/archive/2008/08/04/315.aspx</link>
            <description>&lt;p&gt;I'm often torn between the desire to switch my PC off when I'm not using it as an attempt to perform some token gesture towards being green (every little helps) and the desire to leave it on so that I can access it remotely from where ever I happen to be.&lt;/p&gt;  &lt;p&gt;Wouldn't it be handy if you could allow your PC to sleep automatically but somehow have the ability to wake it up without having to push the power button in the rare event that I would like to use it when I'm nowhere near it?  Turns out there is - however it isn't new, it's just only recently that I've been bothered/driven to investigate this (delete as appropriate) and have been pleasantly surprised as to how easy it is to make it work and how reliably it seems to work.&lt;/p&gt;  &lt;p&gt;Most PCs with modern motherboards support Wake On LAN, which is why when your PC goes to standby or hibernates there is still a link light on the network card - it is still awake and waiting for packet to arrive which would require it to signal the PC to wake.  The packet it's looking out for is known as the magic packet and is specially laid to make it easy for the little brain on board the network card to spot it while the CPU and rest of the PC is turned off.&lt;/p&gt;  &lt;p&gt;The Magic Packet is 102 bytes long made up of a 6 byte header of all 0xFF followed by the target computer's MAC address sixteen times (6 bytes each) and is sent out using UDP.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="60" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb.png" width="390" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;We can build and send one of these from C# reasonably easily using the UdpClient class:&lt;/p&gt;  &lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;   &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
    &lt;span style="color: #008000"&gt;/// Send a magic packet&lt;/span&gt;
    &lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
    &lt;span style="color: #008000"&gt;/// &amp;lt;param name="macAddress"&amp;gt;&amp;lt;/param&amp;gt;&lt;/span&gt;
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Wake(&lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] macAddress)
    {
        &lt;span style="color: #008000"&gt;// A Wake on LAN magic packet contains a 6 byte header and&lt;/span&gt;
        &lt;span style="color: #008000"&gt;// the MAC address of the target MAC address (6 bytes) 16 times&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] wolPacket = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[17 * 6];

        MemoryStream ms = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MemoryStream(wolPacket, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);

        &lt;span style="color: #008000"&gt;// Write the 6 byte 0xFF header&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 6; i++)
        {
            ms.WriteByte(0xFF);
        }

        &lt;span style="color: #008000"&gt;// Write the MAC Address 16 times&lt;/span&gt;
        &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; 16; i++)
        {
            ms.Write(macAddress, 0, macAddress.Length);
        }

        &lt;span style="color: #008000"&gt;// Broadcast the magic packet&lt;/span&gt;
        UdpClient udp = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; UdpClient();
        udp.Connect(IPAddress.Broadcast, 0);
        udp.Send(wolPacket, wolPacket.Length);
    }&lt;/pre&gt;

  &lt;p&gt; &lt;/p&gt;

  &lt;p /&gt;
&lt;/div&gt;

&lt;p&gt;Note, by using a UDP Broadcast the sender and recipient must be on the same subnet, otherwise you'll have to teach your router what's going on.&lt;/p&gt;

&lt;p&gt;This then leads to the question of how to obtain the MAC address of the remote computer.  If you are sat in front of it you can run ipconfig /all at a command line to get the address:&lt;/p&gt;

&lt;table border="1"&gt;&lt;tbody&gt;
    &lt;tr&gt;
      &lt;td&gt;
        &lt;pre&gt;Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . : imeta.co.uk
   Description . . . . . . . . . . . : Broadcom NetXtreme 57xx Gigabit Controller
   Physical Address. . . . . . . . . : &lt;em&gt;&lt;font color="#008000"&gt;00:1C:23:27:CE:C0&lt;/font&gt;&lt;/em&gt;
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : ... etc&lt;/pre&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
  &lt;/tbody&gt;&lt;/table&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Now we have a string with the MAC address we can wake that machine up from someplace else:&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Wake(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; macAddress)
{
    Wake ( macAddress.Split(&lt;span style="color: #006080"&gt;':'&lt;/span&gt;).Select(c =&amp;gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;.Parse(c, NumberStyles.HexNumber)).ToArray() );
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;However, if I don't want to have to run a command on the local computer to wake it up remotely I can ask it over the network what its MAC address is using a protocol called &lt;a href="http://en.wikipedia.org/wiki/Address_Resolution_Protocol"&gt;ARP&lt;/a&gt;.  ARP is used to find out which MAC address currently owns a particular IP address.&lt;/p&gt;

&lt;p&gt;So given the I know the name of the remote PC, I'd like to be able to discover the MAC address and wake it up.  Unfortunately there is no managed class for generating and sending ARP requests, we need to make use of a native DLL:&lt;/p&gt;

&lt;div style="border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, 'Courier New', courier, monospace; background-color: #f4f4f4"&gt;
  &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; NativeMethods
{
    [DllImport(&lt;span style="color: #006080"&gt;"iphlpapi.dll"&lt;/span&gt;, ExactSpelling = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;)]
    &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;extern&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; SendARP(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; DestIP, &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; SrcIP, &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] pMacAddr, &lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; PhyAddrLen);
}

&lt;span style="color: #008000"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// Summary description for ARP&lt;/span&gt;
&lt;span style="color: #008000"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Arp
{
    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] GetMACAddress(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; hostNameOrAddress)
    {
        IPHostEntry hostEntry = Dns.GetHostEntry(hostNameOrAddress);

        &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] macAddr = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[6];
        &lt;span style="color: #0000ff"&gt;uint&lt;/span&gt; macAddrLen = (&lt;span style="color: #0000ff"&gt;uint&lt;/span&gt;)macAddr.Length;

        &lt;span style="color: #008000"&gt;// Find the first IPV4 address for that host&lt;/span&gt;
        IPAddress ipAddress = hostEntry.AddressList.First&amp;lt;IPAddress&amp;gt;(ip =&amp;gt; ip.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork);

        &lt;span style="color: #0000ff"&gt;byte&lt;/span&gt;[] addressBytes = ipAddress.GetAddressBytes();
        &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; address = BitConverter.ToInt32(addressBytes, 0);

        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (NativeMethods.SendARP(BitConverter.ToInt32(addressBytes, 0), 0, macAddr, &lt;span style="color: #0000ff"&gt;ref&lt;/span&gt; macAddrLen) != 0)
        {
            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;;
        }

        &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; addressBytes;
    }
}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Great, so now given the name of a PC we can use DNS to lookup it's IP address, send an ARP request to obtain its MAC address and then wake up the remote computer using a Magic Packet?  Sorted?  No... ARP tells you which MAC address currently owns an IP address, when a computer is in standby it doesn't have an IP address - so it doesn't need to respond to ARP requests.&lt;/p&gt;

&lt;p&gt;While understandable, this is a real shame as it means if a remote computer is asleep there is no means of obtaining it's MAC address; you can only find a computers MAC address if the computer is on!&lt;/p&gt;

&lt;p&gt;In order to produce a useful system to wake up PCs when they're asleep the system needs to know ahead of time which machines I'm likely to want to wake.  By creating a little ASP.NET application we can register the machines that are likely to sleep while they're awake and store the MAC address so that we have it handy when it's asleep.  By placing this application on a central server everyone can register their computers on it and there is one central place to visit to turn them back on again:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="188" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb_2.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Clicking the add computer button will use the hostname string that I've entered, obtain the MAC address for it and squirrel it away into a database.  If the remote machine isn't on at the moment it can't be added to the collection until it is.  However once my PC has been added we can then view the machines I've added and wake any machines of mine that are asleep:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_12.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="124" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb_5.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;By clicking on the "Wake up" link, the asp.net page can use the MAC address stored in the database to create a magic packet and wake the PC up.  We can also do some little touches like pinging the machine as the page loads and tailoring the icons and links available; there's no point waking a machine that's awake!&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_10.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="152" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb_4.png" width="404" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;When my computer is awake it shows up as online:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_14.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="129" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb_6.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;So now are we finished?  Almost!  The web application now has everything it needs to make it work, however if you try it the remote PC probably won't wake up, as Wake-On-LAN is not enabled by default! You need to enable it in your BIOS &lt;em&gt;and&lt;/em&gt; in Windows.  &lt;/p&gt;

&lt;p&gt;In the BIOS it will probably be under power management or similar, like this example:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_16.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="325" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb_7.png" width="420" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;... and then the driver for the network card needs to be taught what's going on.  Locate your network card under Device Manager, and click properties and Power Management and then check "Allow this device to wake the computer"&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_18.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="336" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb_8.png" width="304" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And finally, it seem to help if you tell the network card to expect a Magic Packet as the wake-up signal rather than a ping or any other type of packet:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_20.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="337" alt="image" src="http://blogs.imeta.co.uk/images/blogs_imeta_co_uk/nrees/WindowsLiveWriter/GoingslightlygreenWakeonLANfromASP.NET_8946/image_thumb_9.png" width="304" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;And now we're done!  Your PC should now wake when instructed to by a magic packet!&lt;/p&gt;

&lt;p&gt;So that was a lot of heart-ache, why bother?  A quick burst of maths demonstrates the scale of the cost savings that are possible through a bit of green IT:  Working on the assumption that an idle desktop computer pulls 150w at idle, it means that a powered on PC will burn 1 KWh every 6 hours 40 minutes.  For a PC on 24/7 that's 25.2 KWh per week or 1,310 KWh per year.  Assuming a rough price of 10p per KWh a single PC costs £131 per year to run 24/7.  Now how many PC's do you have around the place?  Two? Five?  Maybe a hundred (£13,100 per year) - a thousand maybe?   &lt;/p&gt;

&lt;p&gt;By making the PC's switch to standby the figures change, let's say each one is on  9AM till 6PM, 5 days a week, 48 weeks of the year (people go on hols!).  The PC is on for 9 hours a day, 2,160 hours per year which consumes 324KWh, which costs £32.40.   A saving of just shy of a hundred pounds per PC per year - assuming the cost of electricity remains constant, and that's probably the worst assumption I've made so far!  As the cost of energy goes up, the savings will increase proportionally too.  &lt;/p&gt;

&lt;p&gt;It's probably worth factoring in the amount of time that the PC is on standby into the equation, as they are still pulling some current:  if the PC is on for 2,160 hours per year, it is off or on standby for 4,200.  Assuming a draw of 5w in that state it will consume 21KWh over the year - costing £2.  I think the case for the savings still holds!&lt;/p&gt;

&lt;p&gt;At &lt;a href="http://www.imeta.co.uk"&gt;iMeta&lt;/a&gt; we have this live now on our intranet site (&lt;a href="http://intranet/wake"&gt;http://intranet/wake&lt;/a&gt; for iMeta people) but it's probably something that anyone who leaves a desktop PC on 24/7 should consider setting up.&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Credits: Thanks go to &lt;a href="http://community.bartdesmet.net/blogs/bart/archive/2006/04/02/3858.aspx"&gt;Bart&lt;/a&gt; and &lt;a href="http://blog.memos.cz/index.php/team/2008/06/12/wake-on-lan-in-csharp"&gt;Lukas&lt;/a&gt; that got me down the road to this solution!&lt;/p&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;26/11/08 Update:  This solution and the source are available to &lt;a href="http://blogs.imeta.co.uk/nrees/archive/2008/11/26/an-asp.net-wake-on-lan-application.aspx"&gt;download&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.imeta.co.uk/nrees/aggbug/315.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Neil Rees</dc:creator>
            <guid>http://blogs.imeta.co.uk/nrees/archive/2008/08/04/315.aspx</guid>
            <pubDate>Mon, 04 Aug 2008 11:24:23 GMT</pubDate>
            <wfw:comment>http://blogs.imeta.co.uk/nrees/comments/315.aspx</wfw:comment>
            <comments>http://blogs.imeta.co.uk/nrees/archive/2008/08/04/315.aspx#feedback</comments>
            <slash:comments>20</slash:comments>
            <wfw:commentRss>http://blogs.imeta.co.uk/nrees/comments/commentRss/315.aspx</wfw:commentRss>
            <trackback:ping>http://blogs.imeta.co.uk/nrees/services/trackbacks/315.aspx</trackback:ping>
        </item>
    </channel>
</rss>