Importing and activating power settings without Group Policy


  1. Posts : 4
    Win 7 64 Bit
       #1

    Importing and activating power settings without Group Policy


    Hi,
    I have a problem which is giving me a headache. Hopefully someone out there knows a way round.
    Basically we are looking to roll out Win 7 64 bit in my company and are currently working on some test models. (At present we use all XP and Server 2003)
    I am building a few test machines and want to find a way to standarize the power settings without having the power settings GPO as (as far as I can tell) that is only available on Server 2008.
    So far I have created a new settings scheme called powertest.pow and exported it to a central network location.
    I can then have other machines import it easily anough by script.
    Then I get stuck. I can only find a way to activate .pow by GUID rather than friendly name and each time the powertest.pow is imported on a new PC it generates a new and unique GUID.
    If I could activate the .pow by friendly name this would be easy, but this doesn't seem to be possible (?). So - what next? Do I need to somehow query the registry, extract the GUID, and then use that to activate my scheme? If so, how? And is it scriptable?
    Thanks in advance for any help or advice that might be out there.
    Neil.
      My Computer


  2. Posts : 127
    Windows 7 Ultimate x64
       #2

    I can't give you a definitive answer, but I do know that somewhere in the registry the name must be mapped to the GUID. If you search the registry for the power settings name you should be able to find where that is stored. From there it shouldn't be a hard thing to grab the GUID and use it.

    The only other possibility is that all of the power settings are stored in one place in the registry and you could just iterate over all of the settings until you found the one with the right name and apply that one.

    Hope these ideas give you a push in the right direction.
      My Computer


  3. Posts : 4
    Win 7 64 Bit
    Thread Starter
       #3

    Hi,
    My previous reply appears not to have been posted so i'll try again: apologies if they now both come up.
    Thanks for your response. I was leaning in that direction myself. All the information you mention is avilable in the registry. Under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Power\User\PowerSchemes all the power schemses are listed by GUID, and within each subkey the Power scheme friendly name is listed as data.
    it's basically the same information you can get from powercfg /l .
    What i don't know how to do though is set up a way to automatically acquire this information for each new PC going forward. it will be easy to remotely set which power schem e hould be active remotely with the relevant GUIDs but if i have to manually go and get the GUIDs each time it will sort of defeat the point.
    Thanks
    again
    N
      My Computer


  4. Posts : 127
    Windows 7 Ultimate x64
       #4

    What you need to do is write a script that queries the registry for all of the power schemes. Once you have that data set, check each one of them for the proper "friendly name" and grab the GUID for that and then apply that scheme.

    Sorry I don't have any sample code for you to check out, but hopefully Google can provide that for you.
      My Computer


  5. Posts : 4
    Win 7 64 Bit
    Thread Starter
       #5

    OK. thanks for the help and advice.
    Time to get better at scripting I suppose...
      My Computer


  6. Posts : 4
    Win 7 64 Bit
    Thread Starter
       #6

    This is actually much simpler than I thought it was.
    For those trying to do the same thing, don't take the path I took. Importing pre-defined .pow schemes and trying to activate them is barking up the wrong tree.
    What you can do instead it have a very simple .bat which copies one of the default powerschemes (as their GUIDs are the same on every single Win 7 machine), rename it and then change the configs by script. Same result as what i set out trying to do and so much easier.
    Here is an example of the script you could use:

    POWERCFG -DUPLICATESCHEME 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635d
    POWERCFG -CHANGENAME 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635d "Superdupertest1"
    POWERCFG -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635d
    POWERCFG -Change -monitor-timeout-ac 0
    POWERCFG -CHANGE -monitor-timeout-dc 0
    POWERCFG -CHANGE -disk-timeout-ac 0
    POWERCFG -CHANGE -disk-timeout-dc 0
    POWERCFG -CHANGE -standby-timeout-ac 0
    POWERCFG -CHANGE -standby-timeout-dc 0
    POWERCFG -CHANGE -hibernate-timeout-ac 0
    POWERCFG -CHANGE -hibernate-timeout-dc 0
      My Computer


  7. Posts : 1
    Windows 7 Enterprise x64
       #7

    Another way to do it is to you the optionnal arguement of the "IMPORT" trigger and set a GUID to use when you import your .POW file

    EX: powercfg /import c:\Some_File.pow FFFFFF-DDDD-CCCC-BBBB-000123456789

    Using this technique you still use the GUID but you can set it to something that is somewhat useable.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 13:47.
Find Us