Answered by:
Script to turn on "Wake on magic packet from off state"

Question
-
Hi,
We have several computers that I am unable to get to Wake On LAN
We have found it is a setting in the power management of the network device
Is it possible to have a VBS that will turn these settings on so we do not have to touch all 100 computers?
These computes are HP 5800, the NIC is Intel 82566DM-2 gigabit
When in the properties of the NIC we click “Configure” and go to “Power Management”
There are 3 settings we would like turned on in this location
Wake on Direct Packet
Wake on Magic packet
Wake on Magic Packet from power off state
Thanks
Saturday, August 22, 2009 7:55 PM
Answers
-
Here is a Powershell script to send the Magic Packet
function Send-WOL{
param ($macaddy)
$mymac = $macaddy.split(':') | %{ [byte]('0x' + $_) }
if ($mymac.Length -ne 6)
{
throw 'Mac Address Must be 6 hex Numbers Separated by : or -'
}
Write-Verbose "Creating UDP Packet"
$UDPclient = new-Object System.Net.Sockets.UdpClient
$UDPclient.Connect(([System.Net.IPAddress]::Broadcast),4000)
$packet = [byte[]](,0xFF * 6)
$packet += $mymac * 16
Write-Verbose ([bitconverter]::tostring($packet))
[void] $UDPclient.Send($packet, $packet.Length)
Write-Host " - Wake-On-Lan Packet of length $($packet.Length) sent to $mymac"
}
Expects the MAC in Hex split by :
Brandon Shell [MVP]- Marked as answer by IamMred Tuesday, August 25, 2009 4:14 PM
Monday, August 24, 2009 12:14 PM
All replies
-
Hi
See the following links...
http://blogs.technet.com/smsandmom/archive/2008/03/04/configmgr-2007-implementing-wake-on-lan-wol.aspx
http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/d5490a38-29e7-4d80-a9c2-f63c717a64f9
http://www.microsoft.com/whdc/archive/netpm.mspxThis may also interest you:
http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/3c5f97f0-de0e-4cb5-b9e3-9f5ee6dc5521
Cheers
Matt :)Sunday, August 23, 2009 6:50 AM -
Here is a Powershell script to send the Magic Packet
function Send-WOL{
param ($macaddy)
$mymac = $macaddy.split(':') | %{ [byte]('0x' + $_) }
if ($mymac.Length -ne 6)
{
throw 'Mac Address Must be 6 hex Numbers Separated by : or -'
}
Write-Verbose "Creating UDP Packet"
$UDPclient = new-Object System.Net.Sockets.UdpClient
$UDPclient.Connect(([System.Net.IPAddress]::Broadcast),4000)
$packet = [byte[]](,0xFF * 6)
$packet += $mymac * 16
Write-Verbose ([bitconverter]::tostring($packet))
[void] $UDPclient.Send($packet, $packet.Length)
Write-Host " - Wake-On-Lan Packet of length $($packet.Length) sent to $mymac"
}
Expects the MAC in Hex split by :
Brandon Shell [MVP]- Marked as answer by IamMred Tuesday, August 25, 2009 4:14 PM
Monday, August 24, 2009 12:14 PM -
Here is a Powershell script to send the Magic Packet
function Send-WOL{
param ($macaddy)
$mymac = $macaddy.split(':') | %{ [byte]('0x' + $_) }
if ($mymac.Length -ne 6)
{
throw 'Mac Address Must be 6 hex Numbers Separated by : or -'
}
Write-Verbose "Creating UDP Packet"
$UDPclient = new-Object System.Net.Sockets.UdpClient
$UDPclient.Connect(([System.Net.IPAddress]::Broadcast),4000)
$packet = [byte[]](,0xFF * 6)
$packet += $mymac * 16
Write-Verbose ([bitconverter]::tostring($packet))
[void] $UDPclient.Send($packet, $packet.Length)
Write-Host " - Wake-On-Lan Packet of length $($packet.Length) sent to $mymac"
}
Expects the MAC in Hex split by :
Brandon Shell [MVP]That's not what he asked for.
I am also in need of this.
Some intel NICs have the WOL settings configurations in the OS>Device manager>NIC>Properties>Power management.
What he(me) needs is a script (most likely some reg merge) which can be run via boot-script (or GPO) to have the setting 'Wake on magic packet from powered off state' enabled.
Your script is to generate and send a WOL packet.
FiloTuesday, July 20, 2010 2:44 PM -
I am also in need of this as well. Anyone find a solution yet to script changing the Advanced wake settings from "Wake on Magic and Directed" to just "Wake on Magic Packet"...
The only thing I can think of is enumerated the NIC in the registry, finding the Reg Value, and changing it that way. But if anyone has a more eloquent solution please share!
Wednesday, August 4, 2010 4:40 PM -
you may want to start a new thread for this sethkn
This is a very old thread and we have since upgraded all our computers and I no longer have this issue
Happy hunting
-Damq
Thursday, August 5, 2010 12:08 AM