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:


     /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.



    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
    Set objReg = Nothing
    Set objWMIService = Nothing
    Set WshShell = Nothing

    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
  • This is the script we use via GPO (shutdown script) to enable PnpCapabilities on the NIC with IP Address:

    @echo off
    (for /F "delims=" %%I in ('wmic path win32_NetworkAdapterConfiguration where "IPEnabled=TRUE" get index /VALUE') do @for /F "tokens=1* delims==" %%J in ("%%I") do SET NICINDEX=%%K )
    REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e972-e325-11ce-bfc1-08002be10318}\000%NICINDEX%" /V PnPCapabilities /T REG_DWORD /D 280 /F

    Tuesday, March 17, 2020 1:35 PM