As an IT manager, there are a lot of things you can do which directly impact your company’s bottom line. While the most obvious are direct hardware and software costs, an often overlooked aspect is energy/electricity consumption by computer systems. While servers need to be available 24/7, desktop systems only need to be available when the respective user needs it or for scheduled maintenance tasks. The rest of the time (usually more than 50% of the time), the system can stay in low power mode which reduces power usage, hence cost.
While Windows systems have options to wake themselves to run scheduled tasks, if users access their systems remotely (i.e. Remote Web Workplace) there is not an easy way for the system to be awakened on demand. The solution is implementing a Wake on LAN system such as the free ASP.NET Wake on LAN Control Panel. Through this, client computers can be brought out of standby with the simple click of a button. This makes is an ideal solution for finding a balance between availability and power savings.
- SQL 2005/2008 (Express or Full) must be installed in your network. Out of the box, the ASP.NET Wake on LAN Control Panel is configured to use SQL Express with user instances but we will show you how to use the full version of SQL Server as well.
- Desktop computers must be configured with the ability to be awakened remotely. Typically, this is the default setting for your network card but if you want to be sure, you can check the device properties of your network card in Device Manager.
- Overall, the documentation which is downloadable from from the ASP.NET Wake on LAN page is very good. It covers using the installer to set everything up, but in true geek fashion we are going to set up everything manually.
Setup the Wake on LAN Control Panel
Create the folder “C:inetpubwwwrootWakeOnLan” and extract the contents of the Wake on LAN zip package.
Open the “Web.config” file and note the connectionStrings section:
<!– Use this connection string for connecting to a SQL 2005/2008 server –>
<!–<add name=”WakeOnLanConnectionString” connectionString=”Data Source=.;Initial Catalog=WakeOnLan;Integrated Security=SSPI” providerName=”System.Data.SqlClient”/>–>
<!– Use this connection string for using the local database with SQLExpress –>
<add name=”WakeOnLanConnectionString” connectionString=”Data Source=.SQLExpress;Integrated Security=True;AttachDBFilename=|DataDirectory|WakeOnLan.mdf;User Instance=true”/>
If you are using SQL Express with user instances enabled (default option during the installation of SQL Express) on the local machine you do not have to modify anything and can ignore the rest of this section, however if you are using the full version of SQL or have SQL Express user instances disabled, you will need comment out/delete the second connectionString key and uncomment the first and save your changes. By default, the SQL Server connection string is set to use the local computer with trusted authentication. Depending on your environment, you may want/need to alter these connection settings.
The ASP.NET Wake On Lan package includes a SQL database creation script to use for setup on SQL Server. Before running this script, you will need to make one minor correction to the the SQL file. Open the file “C:inetpubwwwrootApp_DataSchema.sql” in Notepad and add “WakeOnLan” in the location highlighted:
Once this is done, save the changes and then run the install script as a Windows Administrator (where –S “.” specifies the SQL Server to install to):
SqlCmd -S “.” -E -i “C:inetpubwwwrootApp_DataSchema.sql”
Configure IIS to Run the Wake on LAN Control Panel
Once you have the files and database in place open Internet Information Services Manager. Under the ‘Default Web Site’ you should see the WakeOnLan folder. Before the control panel can be used, you must convert the directory to an application which runs on .NET version 2.0.
In IIS 7, you simply need to right click on the folder and select ‘Convert to Application’. In IIS 6, you need to use the ‘Add Application Wizard’ which is available by right clicking on the ‘Default Web Site’.
The default settings of the application are typically correct and do not need to be modified.
Once the application is created, you should be able to access the ASP.NET Wake on LAN Control Panel by visiting “http://localhost/WakeOnLan”. If this does not work, check to make sure:
- The IIS WakeOnLan application is running in a .NET 2.0 AppPool.
- Your SQL connection strings are correct in your Web.config file.
Once you have set up the control panel, all that is left is to add computers. This is pretty intuitive, just click the ‘Add New Computer’ link and enter either the computer name or local IP address of the system to add.
The MAC Address will automatically be resolved and the new computer will appear in the list.
Using the Wake on LAN Control Panel
Usage of the ASP.NET Wake on LAN Control Panel is incredibly intuitive. When you access the page, the status of the connected computers is scanned and presented.
- Computers which are active/awake, are presented in blue.
- Computers which are asleep (standby/hibernation) are presented in black.
- Computers which are waking up are yellow.
To wake a computer, simply click the appropriate link.
The computer will turn yellow and a few minutes later, it will turn blue. After about 30 seconds, the computer which was asleep is now ready to be accessed.
The ASP.NET Wake on LAN Control Panel can easily be made available outside your network. As long as the IIS web site you have configured it in is available externally, you can access the control panel from http://www.domain.com/WakeOnLan. You would just need to train your users to access this page prior to connecting to their computer. For example, by adding a link to a company portal to access the control panel can minimize the “how do I do that again?” questions.
Download ASP.NET Wake On LAN (zip package)
- Published 07/22/10