« Random notes on Scripting for PowerShell | Sample Script - remote shutdown or hibernation of a Windows system »

Sample Script - WOL or Wake On Lan

In order to save power and keep my garage from overheating, I turn off my home file server when not in use. I used to manually run out to adjust the Big Red Switch, but then I decided to get lazy and script the WOL process... and use hibernate instead. Hibernate is sooo much better in Windows 2003 !

Requirements:
1. WOL support. Just about everything nowadays should support it, check your BIOS settings.
2. The freeware WOL application wolcmd.exe from Depicus.

This script is really simple, it just asks you to confirm you really want to wake up the server, then calls wolcmd.exe from the command line and then pings continuously. Once you get replies, just close the window.

The syntax for wolcmd.exe is simple, just call the executable with <MACaddress> <IPaddress> <subnetMask> 7 like this:

wolcmd.exe 008063C51D8A 172.16.10.200 255.255.255.0 7

Make sure to remove the hyphens from the MAC. The value 7 is the port number and should work on LANs without issues. See the note here for more info about doing this across a firewall.

Sample script WakeOnLAN .

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)