SEARCH

How-To Geek

Setup a Wake on LAN Control Panel for your Network

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.

Requirements

  • 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.

image

Open the “Web.config” file and note the connectionStrings section:

<connectionStrings>
<!– 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”/>
</connectionStrings>

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:

image

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’.

image

The default settings of the application are typically correct and do not need to be modified.

image

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.

image

Adding Computers

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.

image

The MAC Address will automatically be resolved and the new computer will appear in the list.

image

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.

image

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.

image

Conclusion

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.

Links

Download ASP.NET Wake On LAN (zip package)

Jason Faulkner is a developer and IT professional who never has a hot cup of coffee far away. Interact with him on Google+

  • Published 07/22/10

Comments (3)

  1. dmtelf

    This looks perfect for me & I’ve been looking for something like this for a LONG time! Thank you for developing it, making it available for free & writing this article!

    However, I’m having problems installing it at the moment :-(

    I installed SQL Server Express 2005 on my Windows 7 Ultimate box, installed all Windows updates etc & downloaded the ASP.NET Wake on LAN zip package which consists of setup.exe & WebSetup.msi

    As I can’t extract setup.exe or WebSetup.msi from within Explorer in 7, I tried to run setup.exe but it stops with an error: “Installation Incomplete – the installer was interrupted before Wake On LAN could be installed. You need to restart the installer to try again. Click Close to exit”.

  2. Nick

    Install dot net 1.1 and its service packs fixed it for me.

  3. Nickro

    I tried doing it both ways.
    1. When I try to run the script in the command line I get the error sqlcmd is not recognized. I tried going to the directory that sqlcmd.exe is located (C:\Program Files\Microsoft SQL Server\100\Tools\Binn) and running it runs but it still does not recognize the command.
    2. So I tried to just use the installer but I get the same error as dmtelf gets. I installed .NET 1.1 and SP1. Still get the error when trying to run it.

    Any ideas or advice would be appreciated.

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!