+ Post New Thread
Results 1 to 2 of 2
Windows Thread, Wake on Lan woes in Technical; Hey folks! I need some pointers / guidance / solutions / anything, this WOL thing is really bustin my n*ts. ...
  1. #1
    jpaterson's Avatar
    Join Date
    Feb 2009
    Thank Post
    Thanked 6 Times in 6 Posts
    Rep Power

    Wake on Lan woes

    Hey folks!

    I need some pointers / guidance / solutions / anything, this WOL thing is really bustin my n*ts.

    In an attempt to get on the 'Green IT' bandwagon, I'm looking at the possibility of shutting machines down every evening and waking them early in the morning, ready for use. I spent 3 days auditing the networking hardware across the domain, considering what NICs are WOL capable and which aren't. So, the ones that are WOL capable, are sorted in the BIOS. However, I find that the there is a particular setting in the Advanced Settings tab of the device properties that is really ruining my day. I tried the following script (which I picked up from another post here), to use WMI to 'theoretically' enable the settings that Power Management needs to get things moving....

    Option Explicit
    Dim colNetworkAdapters
    Dim objNetworkAdapter
    Dim strDevInstanceName
    Dim strNetworkAdapterID
    'Query for all of the Win32_NetworkAdapters that are wired Ethernet (AdapterTypeId=0 corresponds to Ethernet 802.3)
    Set colNetworkAdapters = GetObject("WinMgmts:{impersonationLevel=impersonate, (LoadDriver)}//./root/Cimv2")_
    .ExecQuery("SELECT * FROM Win32_NetworkAdapter WHERE AdapterTypeId=0")
    WScript.Echo "Enabling WoL for the following adapters:"
    For Each objNetworkAdapter In colNetworkAdapters
                WScript.Echo "  " & objNetworkAdapter.Name & " [" & objNetworkAdapter.MACAddress & "]"
                strNetworkAdapterID = UCase(objNetworkAdapter.PNPDeviceID)
                'Query for all of the MSPower_DeviceWakeEnable classes
                Dim colPowerWakeEnables
                Dim objPowerWakeEnable
                Set colPowerWakeEnables = GetObject("WinMgmts:{impersonationLevel=impersonate, (LoadDriver)}//./root/wmi")_
                .ExecQuery("SELECT * FROM MSPower_DeviceWakeEnable")
                'Compare the PNP Device ID from the network adapter against the MSPower_DeviceEnabled instances
                For Each objPowerWakeEnable In colPowerWakeEnables
                            'We have to compare the leftmost part as MSPower_DeviceEnabled.InstanceName contains an instance suffix
                            strDevInstanceName = UCase(Left(objPowerWakeEnable.InstanceName, Len(strNetworkAdapterID)))
                            'Match found, enable WOL
                            If StrComp(strDevInstanceName, strNetworkAdapterID)=0 Then
                                        objPowerWakeEnable.Enable = True
                                        objPowerWakeEnable.Put_           'Required to write the value back to the object
    			WScript.Echo "Found MSPower Class...Wake enable set."
                            End     If
                'Query for all of the MSNdis_DeviceWakeOnMagicPacketOnly classes
                Dim colMagicPacketOnlys
                Dim objMagicPacketOnly
                Set colMagicPacketOnlys = GetObject("WinMgmts:{impersonationLevel=impersonate, (LoadDriver)}//./root/wmi")_
                .ExecQuery("SELECT * FROM MSNdis_DeviceWakeOnMagicPacketOnly")
                'Compare the PNP Device ID from the network adapter against the MSNdis_DeviceWakeOnMagicPacketOnly instances
                For Each objMagicPacketOnly In colMagicPacketOnlys
                            'We have to compare the leftmost part as MSNdis_DeviceWakeOnMagicPacketOnly.InstanceName contains an instance suffix
                            strDevInstanceName = UCase(Left(objMagicPacketOnly.InstanceName, Len(strNetworkAdapterID)))
                            'Match found, enable WOL for Magic Packets only
                            If StrComp(strDevInstanceName, strNetworkAdapterID)=0 Then
                                        objMagicPacketOnly.EnableWakeOnMagicPacketOnly = True  'Set to false if you wish to wake on magic packets AND wake patterns
                                        objMagicPacketOnly.Put_             'Required to write the value back to the object
    			WScript.Echo "Found Magic Packet Class...Wake enable set."
                            End     If
    However, after much local and remote testing, the script doesn't do anything to enable WOL. I have narrowed it down to one or two settings on the Advanced Settings tab of the device properties.


    The problem is, this setting needs applied across 100 or so machines (in addition to any new machines that are rebuilt/imaged). Can anyone advise me on how to change this setting programatically, across the domain?

    Any help, ideas, anything! as always, very much appreciated.

  2. #2

    glennda's Avatar
    Join Date
    Jun 2009
    Thank Post
    Thanked 1,138 Times in 1,034 Posts
    Rep Power
    not going to help you here but if a member of staff/student just turns the pc off by the button and the pc hasn't gracefully shutdown then it won't wol

    but we use the built in parts to fog which does all this including the shutdown. One thing you need to bear in mind is that a simply shutdown -f -s -m \\machinename will not take into account if a user is still logged in - meaning they could lose work. Whereas fog will only shut the pc down if nobody is logged in.

    We therefor have a scheduled shutdown at 4pm - 430pm, 5pm, 6pm and 7pm. therefore more of a chance of shutting all pc's down.

+ Post New Thread

Similar Threads

  1. How to Wake on LAN
    By roland in forum How do you do....it?
    Replies: 17
    Last Post: 19th November 2010, 10:02 AM
  2. Wake on LAN across VLANs/subnets - 3Com Layer-3 Switch 5500
    By SSTechIII in forum Wireless Networks
    Replies: 17
    Last Post: 28th April 2008, 09:09 PM
  3. Wake on Lan
    By comedydave in forum How do you do....it?
    Replies: 11
    Last Post: 18th March 2008, 03:08 PM
  4. Dell Latitude 131L - wake on lan
    By srochford in forum Hardware
    Replies: 0
    Last Post: 22nd November 2007, 05:01 PM
  5. Wake on LAN and hibernate
    By ZeroHour in forum Windows
    Replies: 3
    Last Post: 21st June 2006, 09:35 AM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts