Need Help Changing System Standby to Never

(imported topic written by tscott91)

I am trying to get my system stand by setting to “Never” for all desktops and “Never” while “Plugged In” for laptops… If I can only get it to “Never” period and not just for the plugged in for laptops I’d be fine with that…

I tried changing the power profile key in the registry and that is working, however, it’s not changing the settings beneath it…

The key is HKEY_CURRENT_USER\Control Panel\PowerCfg and the value is CurrentPowerPolicy… To see what I mean, open up your power properties and cycle through the power schemes… You’ll see the values change in the drop downs below it…

However, if you change the value in the registry you’ll see that in the power properties the power scheme changes but the settings below don’t!

Any ideas?

(imported comment written by SystemAdmin)

This may not address the Plugged Un-Plugged question but

in windows 7 and 2008 the default Schemes there’s a (High Performance) Scheme, you can set it with the following command

powercfg -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

C:>powercfg -l

Existing Power Schemes (* Active)

Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)

Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance) *

Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)

on Windows XP and Windows 2003

http://support.microsoft.com/kb/324347/en-us

the command is

powercfg -s "Always On"

U:>powercfg -l

Existing Power Schemes

Max Battery

Minimal Power Management

Always On

Presentation

Portable/Laptop

Home/Office Desk

(imported comment written by tscott91)

DOH! That is so much easier then the registry edits I was doing!

So the action would be just:

powercfg -s “Always On”

for Windows XP/2003?

(imported comment written by SystemAdmin)

Yes

runhidden powercfg.exe -s “Always On”

or I like to fully qualify things

if {(it as lowercase contains "xp" or it as lowercase contains "2003") of name of operating system}
runhidden {(pathname of system folder)}\powercfg.exe -s "Always On"
endif
if {(it as lowercase contains "win7" or it as lowercase contains "2008") of name of operating system}
runhidden {(pathname of system folder)}\powercfg.exe -s 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
endif

(imported comment written by tscott91)

Very strange… When I run that action through the console to the client it fails and I confirmed by checking the power settings… However, when I run that same exact action on a client through the debugger it works and changes the power settings. :S

(imported comment written by SystemAdmin)

try fully qualifying it

runhidden {(pathname of system folder)}\powercfg.exe -s “Always On”

it works for me ?

you can also make changes to the default policys like changing the (AC) and (DC) settings to handle the rest of your request

runhidden {(pathname of system folder)}\powercfg.exe /change “always on” /standby-timeout-ac 0

runhidden {(pathname of system folder)}\powercfg.exe /change “always on” /hibernate-timeout-ac 0

runhidden {(pathname of system folder)}\powercfg.exe /setactive “always on”

U:>powercfg -q

Field Description Value

Name Always On

Numerical ID 3

Turn off monitor (AC) Not Supported

Turn off monitor (DC) Not Supported

Turn off hard disks (AC) Never

Turn off hard disks (DC) After 30 mins

System standby (AC) Never

System standby (DC) Never

System hibernates (AC) Never

System hibernates (DC) Never

Processor Throttle (AC) Not Supported

Processor Throttle (DC) Not Supported

(imported comment written by tscott91)

What the heck… It still fails for me even though it runs fine on this test PC via the debugger… I’ve tried it on two PC’s and it fails on both…

(imported comment written by MattBoyd)

Try running the powercfg commands with RunAsCurrentUser.exe. XP power profile settings are stored in the user profile.

FYI, if you have the BES Power Management site, you can use the power profile wizard to do this.

(imported comment written by tscott91)

What’s weird is in the debug log it shows successful however the console shows failed…

Mon, 09 Aug 2010 15:33:39 -0400: DebugMessage (ActionLogMessage: (action 10652 ) Action signature verified)

Mon, 09 Aug 2010 15:33:39 -0400: DebugMessage (ActionLogMessage: (action 10652 ) starting action)

Mon, 09 Aug 2010 15:33:39 -0400: DebugMessage (bumping active action line)

Mon, 09 Aug 2010 15:33:39 -0400: DebugMessage (Command succeeded runhidden C:\WINDOWS\system32\powercfg.exe -s “Always On” (fixlet 10652))

Mon, 09 Aug 2010 15:33:39 -0400: DebugMessage (bumping active action line)

Mon, 09 Aug 2010 15:33:39 -0400: ActionDebugMessage (action 10652 ) DoWork: Action completed.

Mon, 09 Aug 2010 15:33:39 -0400: DebugMessage (ActionLogMessage: (action 10652 ) ending action)

Mon, 09 Aug 2010 15:33:39 -0400: ActionDebugMessage (action 10652 ) removed from pending list (no longer relevant)

Mon, 09 Aug 2010 15:33:39 -0400: DebugMessage (Not Relevant - Set Power Profile to Always On (fixlet:10652))

(imported comment written by tscott91)

Ok, after working with support to find out why it’s failing it was something extremely stupid… I created it as a fixlet instead of a task and the relevance was set to “true”…

Anywho, this is working great… Now, anyone know a relevance I can use to deploy this? Is there a way to query the values for system standby and have it relevant to any system where standby never?

Thanks!

(imported comment written by SystemAdmin)

This is available on Windows 7 and 2008 R2

Q: Select “ElementName from Win32_PowerPlan where IsActive = True” of wmi “Root\CIMV2\power”

A: ElementName=High performance

Q: Selects “* from Win32_PowerPlan where IsActive = True” of wmi “Root\CIMV2\power”

A: Caption

A: ChangeableType

A: ConfigurationName

A: Description=Favors performance, but may use more energy.

A: ElementName=High performance

A: InstanceID=Microsoft:PowerPlan{8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c}

A: IsActive=True

Q: Selects “* from Win32_PowerPlan” of wmi “Root\CIMV2\power”

A: Caption

A: ChangeableType

A: ConfigurationName

A: Description=Automatically balances performance with energy consumption on capable hardware.

A: ElementName=Balanced

A: InstanceID=Microsoft:PowerPlan{381b4222-f694-41f0-9685-ff5bb260df2e}

A: IsActive=False

A: Caption

A: ChangeableType

A: ConfigurationName

A: Description=Favors performance, but may use more energy.

A: ElementName=High performance

A: InstanceID=Microsoft:PowerPlan{8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c}

A: IsActive=True

A: Caption

A: ChangeableType

A: ConfigurationName

A: Description=Saves energy by reducing your computer%92s performance where possible.

A: ElementName=Power saver

A: InstanceID=Microsoft:PowerPlan{a1841308-3541-4fab-bc81-f71556f20b4a}

A: IsActive=False

(imported comment written by tscott91)

I would still like to get this relevance working for XP systems… Basically I want to know if any PC’s have standby enabled. Whether it be 1 minute or 60 minutes, I don’t care, just that it’s enabled…

I’m not sure if that’s possible though…

I know I can do something like this:

value "CurrentPowerPolicy" of key "Control Panel\PowerCfg" of current user keys (logged on users) of registry is "1"

However, the system standby can still be enabled even if the Power Profile is “Always On”

Thanks much!