none
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]
    Monday, August 24, 2009 12:14 PM
    Moderator

All replies

  • 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]
    Monday, August 24, 2009 12:14 PM
    Moderator
  • 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.


    Filo
    Tuesday, 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 04, 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 05, 2010 12:08 AM