none
Enabling Power Management options for WOL via RegEdit script or group Policy RRS feed

  • Question

  • Hi All,

    I have looked absolutely everywhere for an answer to this but i just cannot find one! We have a range of Computers some new, some older but all that can wake on lan. We use Dell Kace which will wake up computers however it seems that some do not have the correct settings under Power Management in the Network adapter.

    I have looked all through RegEdit to try and find which values are changed so i can attempt to make a script to edit these settings to the correct value but to no avail!

    Any help would be greatly appreciated as we have 600 computers and i dont want to have to go round all of them manually to check this setting!

    Thanks in Advance,

    Samuel Baker


    Samuel Baker

    • Moved by Bill_Stewart Thursday, January 2, 2014 7:11 PM Abandoned
    Wednesday, October 30, 2013 12:09 PM

All replies

  • Just run PowerCfg.

    For instructions:

    POWERCFG /?

     /DEVICEENABLEWAKE  Enables a device to wake the system from a sleep state.

    This sets the correct settings.  The registry entries are driver/vendor specific and are not documented.


    ¯\_(ツ)_/¯

    Wednesday, October 30, 2013 12:57 PM
  • Just Refer this Script

    I think the registry key value is HKLM\SYSTEM\CurrentControlSet\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}\DeviceNumber

    Check for PNP. If you are looking for the same I can share the code to do bulk update for 600 computers


    Regards Chen V

    Wednesday, October 30, 2013 12:58 PM
  • Chen - that script does not set WOL settings.  It sets the Power settings that allow a local connection to wake up the adapter.  It works for outbound but not when a remote connect asks for the system.

    WOL also needs to enable "magic packet".  Each adapter can use a slightly different technique.  There is an API that gets called.  When we use PoweCfg it sets these according to the driver and not just a registry setting.

    We need to set first the wakeup state then enable the adapter. Last the magic packet has to be enabled.

    The powerstate settings are different for different OSs.  XP, WS2003, Vista and later all use slightly different settings.

    Sometimes that script will work assuming everything else is set correctly.  If not then it won't work.

    Here is another script that uses advanced settings.  It will work more often but may still have issues.

    http://social.technet.microsoft.com/Forums/scriptcenter/en-US/7796fee0-1e93-40a2-ad1c-e8c406427edb/script-to-enable-allow-this-device-to-bring-the-computer-out-of-standby?forum=ITCG


    ¯\_(ツ)_/¯

    Wednesday, October 30, 2013 1:18 PM
  • Good Points - Thanks jrv

    Regards Chen V

    Wednesday, October 30, 2013 1:31 PM
  • I'll post my script, but some points to get out of the way first:

    • This script is used during OSD, so it was written (read: edited - I forget where the source came from, thanks whoever you are) to run on the local machine ONLY. You'll want to adjust that unless you have some method of deploying it.
    • All machines in my environment are a single Dell model (I've used this script with multiple models, but worth mentioning).
    • All are running Win7.
    • You will need to adjust this script. It works for me, it might not for you.
    • Read the first bullet point again. Seriously.

    '*************************************************************************
    ' EnableWOL_Win7.vbs
    ' This script enables WOL and sets magic packets as the wakeup type.
    ' Intended for use in OSD from SCCM.
    ' 5/17/11 Mike Laughlin
    '*************************************************************************
    
    'Declare variables
    Dim objWMIService 'WMI Service Object
    Dim arrayNetCards 'Array of all connected NICs
    Dim objNetCard 'A specific NIC
    Dim strPnPCapabilitesKeyName 'Key Specific to the Network Adapters in CurrentControlSet
    Dim strPnPCapabilitesKeyName001 'Key Specific to the Network Adapters in ControlSet001
    Dim PnPdwValue 'DWORD Value
    
    'Define variables and constants
    Const HKLM = &H80000002
    
    strPnPCapabilitiesKeyName = "SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"
    strPnPCapabilitiesKeyName001 = "SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\"
    
    PnPdwValue = 288
    '288 on Win7 turns on WOL capabilities and only allows magic packets.
    
    'Connection strings
    On Error Resume Next
    Set objReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")
    Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
    
    'Look for the NICs that have IP enabled
    Set arrayNetCards = objWMIService.ExecQuery ("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
    
    'Make changes on the NICs that have IP enabled
    For Each objNetCard in arrayNetCards
    
    	'Get the DeviceID of the NIC
    	strDeviceID = Mid(objNetCard.Caption,6,4) 
    
    	'Change the Power Management Values
    	objReg.SetDWORDValue HKLM, strPnPCapabilitiesKeyName & strDeviceID & "\","PnPCapabilities",PnPdwValue
    	objReg.SetDWORDValue HKLM, strPnPCapabilitiesKeyName001 & strDeviceID & "\","PnPCapabilities",PnPdwValue
    
    Next
    
    'Cleanup
    Set objReg = Nothing
    Set objWMIService = Nothing
    Set WshShell = Nothing
    
    WScript.Quit
    
    'EOF

    Editorial note: Its amazing when I go back and look at some of my old code and see how bad it is. Oh well, it works.


    Don't retire TechNet! - (Maybe there's still a chance for hope, over 12,300+ strong and growing)


    Wednesday, October 30, 2013 1:32 PM
  • Mike - All

    You script is very similar to the link I posted but the link uses WMI.  WMI resolves some issues that may occur between different OS and vendors and the registry access method is vendor dependent most of the time.  I do not know if it works always for the same vendor.  It doesn't for HP.  It might for Dell.

    Pick all methods and test.  Choose the method that appears to be best suited.

    PowerState configuration can and should be done via a GPO. Adapter WOL should be set via vendor utility but can be set via WMI on Windows 7 and later with WIn7 logoed adapters.  Consumer grade machines will generally fail this test.

    Good luck.


    ¯\_(ツ)_/¯

    Wednesday, October 30, 2013 1:52 PM