Background

This is a simple script to send a WOL packet to an IP address, usually the broadcast address in a subnet. 

There are similar scripts found on the Internet but I don't seem to find one that takes a broadcast IP address as one of the parameters, and that is the main reason I want to share this script here.

To use this script, you need to specify the MAC address of the device that you need to wake using -mac parameter.  The default UDP port is 9, but using other port number, e.g. 7, is not uncommon.  You can specify a different port using the -port parameter.

The script takes a mac address either separated with ":" or "-" (the typical format), or separated by "." (the Cisco format), or no separator (the lazy format :P )

Usage

HTML
编辑脚本|Remove
Send-WOL -mac 00:11:32:21:2D:11 -ip 192.168.8.255 -port 7 
 
Send-WOL -mac 00-11-32-21-2D-11 -ip 192.168.8.255 -port 7 
 
Send-WOL -mac 0011.3221.2D11 -ip 192.168.8.255 -port 7 
 
Send-WOL -mac 001132212D11 -ip 192.168.8.255 -port 7 
 
Send-WOL -mac 001132212D11