- WOL.aspx  -


Quite often I face the problem to power on my computer when I am on a remote site.
I have a home server that runs 24/7 so I used a command line tool and batch files to wake up my workstation using remote desktop. My home server runs IIS, so I had the idea to built a small web page to do the “wake up process “ using a web browser.

Technical background
Nearly every “modern” computer offers a feature called Wake On Lan. Using this function, that might hava to be activated in the BIOS, you can turn on your computer by sending some command over the network cable. This is often called the “Magic Packet”.
If you want to dive deeper into the technical details, you can find them
here on codeproject. (2011-09-25)

The script itself is not much magic, just a few lines of code. (Actually this description has [much] more characters than the source code.

What do you need to run it
Any .aspx capable web server. IIS6 or IIS7, maybe Cassini runs it too.


How do I use it ?
Place it somewhere in a Virtual Folder or a  Webspace, that’s it.
Make sure that this server is directly connected to the network with the hosts you plan to wake up.
If the host is in another subnet, check if the router that connects those networks let the magic packet pass.
All you have to do is to open the wol.aspx and pass the MAC and an optional title as an URL parameter.

This for example wakes up the pc in my living room ( is my home servers ip address):

In return you get this:
OK: Magic packet was sent to Living-Room-PC (0019bbe4a5e1)

If something is wrong or an error happened, the message will show details about it. E.g.:
Error: Error in MAC format (try: 001122334455)

You can set up a web page that holds links to all your computers and have one single WOL entry point like this:

 <a href="./wol.aspx?MAC=0019bbe4a5e1&title=Windows%207%20Workstation">Wohnzimmer PC</a>


Can I integrate it in my existing web pages like my CRM or Alfresco ?
Sure just strip down all HTML tags from the output and you can use it using JSONP .

Can I use it from my Sharepoint  sites ?
Sure, but the configuration takes a few steps, they are described
here, but in return you get a Sharepoint list that has clickable links to turn on your hosts by just entering the Hosts name and the MAC address. (Be warned, loading could take a while,  there are a lot of printscreens !)

My computer doesn’t turn on, even after enabling it in the BIOS
Be sure to have the latest driver for the network interface card installed.
Don’t trust the one that comes with Windows. I don’t want to say they are bad or something, I’ve just noticed that they did not support the WOL on my Intel Chipset. I guess they don’t support all features of the chipset. After downloading the latest driver from the manufacturers homepage WOL works like a charm.

If you find bugs or have suggestions, please use the SF tracker.

Version History:

20110925 1.00 initial release




Windows, C# & .NET  & Sharepoint are registered trademarks of Microsoft Corporation in the United States and other countries.  (http://www.microsoft.com)