Power Manangement - Apply Profile Only If Current Profile Is Less

(imported topic written by SystemAdmin)

We’d like to push out a power management profile that gets applied if the current profile is less stringent but not if the current profile is more stringent. In other words, if the existing power profile has settings that put the pc into power save sooner than the BigFix power profile we defined, let it go, but if it waits longer to put the pc into power save, then apply the BigFix defined profile.

I know a true relevance wizard could whip this up, but looking at the existing relevance of one of the BigFix created power profile fixlets gives me nausea and looks just like a plate of spaghetti – minus the sauce.

Is there a relatively easy way to accomplish this?

John

(imported comment written by MattBoyd)

This is a really interesting idea. But I have to ask… what’s your definition of “easy” John? :stuck_out_tongue:

I’m not sure about Windows XP, but for Windows 7, I think you can find the GUID of the currently active power scheme under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes. The keys under that one identify the power schemes (as GUIDs) under that power scheme. Underneath those keys are additional keys (GUIDs of course) that identify settings, subsettings, and their values. If you’re feeling ambitious, you can find the registry keys and values associated with the settings that you want to check and compare.

Here’s a writeup by yours truly that will give you the low down on those scary GUIDs: http://iboyd.net/index.php/2010/05/07/windows-7-power-management-applying-power-settings-with-powercfg/

Here’s some relevance that I wrote for a task back in July that is similar to what you might be trying to do… bonus points if you can figure out what setting it’s looking for :wink:

name of operating system = “Win7” and not exists (key “d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d” of (key (value “ActivePowerScheme” of it as string & “\238c9fa8-0aad-41ed-83f4-97be242c8f20”) of it) of key “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\User\PowerSchemes” of registry) whose (value “ACSettingIndex” of it = 1 and value “DCSettingIndex” of it = 1)

By the way, I agree that the power profile relevance is nausea-inducing.

(imported comment written by SystemAdmin)

{buzz} “I believe that would be the sleep after n time setting (seconds).”

I don’t know if even conceptually this is any way ‘easy’ to do, competely ignoring the technical hoops you have to jump through to extract and compare the entries.

Do you think you can reasonably construct metrics for how you might balance setting A(display brightness=75%, HD off after 10 mins, min cpu=5%, max cpu=100%) vs setting B(display brightness=100%, HD off after 5 mins, min cpu=5%, max cpu 80%)? {shrug}

Rather than come up with a convoluted technical process to assess the settings, I think I would be tempted to extract data to see what people are actually doing and do some work based on what you find. See how many are set to:

A: one of the default settings (with nothing changed) <-- fairly easy to do

B: using a modified setting, and if so, which ones <-- trickier, but doable.

Once you know what % of your users are B, assess what their settings are (data extract). I’d guess that they would probably fall fairly obviously into two camps - those that love battery life and have great settings and others that can’t copy with lousy battery modes and like performance (for about 45-60 minutes on battery). Decide what to do about those.

For the A camp, push out your preferred settings and set all of those not already on ‘low’ to your preference. And for later testing, make a note of which setting was pushed out by you and can compare where settings have changed (Have any A’s become a B’s? Have any A’s with new modified settings pushed it back to Balanced or Performance? If so, change it back and beat them with a stick.)

This is not a trivial issue, but I do think it’s worth doing. It’s just a shame that there are so many factors involved and the process to modify them is not easy. So I think you need to stop using that word! :wink:

-Jim

(imported comment written by SystemAdmin)

Hey John,

The relevance for power profiles is pretty hairy to look at (I dont know if you should blame me or microsoft for that), but this is because it has to do a complicated song and dance to figure out where to find the values it needs to check. If you were to abstract those statements out, the relevance would look like this:

() AND (( “my Profile name” != ()) OR ( “10” != ) OR (… etc … ))

All you want is to change those “!=” string checks to be a “>=” number check. A trick way of doing this would be just to do a search for “!=” and if there is a number on the left site of it, replace it with “>=” and make them integers instead. So for example:

… OR (( “0” != ( if …

becomes

… OR (( 0 >= (it as integer) of ( if …

(bascially, removed the quotes from around the number, change the comparison, and added "(it as integer) of " to the other side of the operator )

Howver, this will still enforce the policy if the profile name changes. Probably the easiest way to remove this is to do another search for the profile name you’ve specified and just edit the check so that its always true. Heres what mine looks like to start with:

(

if

name of operating system = “Mac OS X”

then

“Custom”

else

“My profile”

)

as lowercase != it as lowercase

AND

“Unknown” != it

) …

became

( (

if

name of operating system = “Mac OS X”

then

“Custom”

else

“My profile”

)

as lowercase != it as lowercase

AND

“Unknown” != it

)

OR TRUE

) …

Note the extra set of parentheses around the whole clause.

I started this off in my head as “oh this will be easy”, but after writing it out it looks pretty convoluted (thought i still consider the actual process some for of “easy”). Ill file a bug on it, and hopefully we can get some UI to take care of this in some future version of the Create Power Profile Fixlet wizard.

-Zak Kus

(imported comment written by MattBoyd)

Hey Zak, Windows 7 has several “advanced” power management settings that can be set in each power profile, such as “Allow sleep with remote opens.” I have a task that can set some of these, but is there any chance that they will make it into the wizard (eventually) as well?

(imported comment written by SystemAdmin)

Yeah, we’ve wanted to do that one for a while, though I do know when a it may come out in a release (though its definitely on our radar)

(imported comment written by SystemAdmin)

Thanks everyone for the great input.

Boyd, I’d be very interested in the tasks you have for the “advanced” win7 power settings…

Zak, I won’t blame you for the relevance spaghetti - especially since you provided the easiest way to do what we wanted :slight_smile: I will be trying this soon enough and would second your vote that this be part of the default features of the Power Management site.

To clarify two things:

  1. If we change the logic to >= for each setting, is each setting evaluated individually or as a group? In other words, if one value is >= but another is < , will the profile become relevant or do all values have to be >=?

Howver, this will still enforce the policy if the profile name changes.

  • You are saying that if the user changes the power profile name (by creating a new profile), that without modifying the relevance further, the fixlet will apply if the profile name is different, correct?

Thanks again to everyone!

(imported comment written by MattBoyd)

Sharing is caring

(imported comment written by SystemAdmin)

jspanitz

  1. If we change the logic to >= for each setting, is each setting evaluated individually or as a group? In other words, if one value is >= but another is < , will the profile become relevant or do all values have to be >=?

The relevance checks each value individually. The normal power fixlet basically says “become relevant if any setting does not match what i’ve specified”, this modified fixlet will have relevance that says “become relevant if any setting is larger than what i’ve specifed”.

Note that the action is still set to enforce all the settings, so if only one setting is set too high, the fixlet will become relevant and force all the settings back to the fixlets default (even if they were lower). There are ways to deal with this by editing the action, but it might be more complicated than you want to deal with right now.

jspanitz

  • You are saying that if the user changes the power profile name (by creating a new profile), that without modifying the relevance further, the fixlet will apply if the profile name is different, correct?

Thats right.

(imported comment written by SystemAdmin)

So after changing the relevance the targeting seems correct. However, the custom Power Management fixlet always stays relevant now. So perhaps instead of >= we should have done >?

John

(imported comment written by SystemAdmin)

ah, you’re correct, it should be >. The other way will actually cause you a big problem, if its set as a policy action (it will constantly reapply)

(imported comment written by SystemAdmin)

Ok, one last question (I Hope).

Why is the relevance “exists current user” included? Why does applying a power profile depend on a current user? I ask because we have a few XP machines that get logged into very infrequently and due to that the power profiles are not getting applied. Also, some of those are accessed using remote desktop which also does not trigger “exists current user”.

Edit: Looks like we still have logic issues outside of the above question.

So we are trying to apply a power profile if an app is running and another profile if it is not running. That’s the easy part. The part we are still struggling with is the issue of the power profile comparison. Both power profiles are identical except for the Standy seting. When the app is running, we don’t want the pc to go into standby. When the app is not running we want it to eventually go into standby.

The relevance was generated by the “Create Power Profile” wizard. We need it to check the standby setting and remove if it is set.

John

(imported comment written by SystemAdmin)

OK. Figured this all out. Way to much trial and error was required :(. But in the end we have a baseline with two fixlets - one enables standby and one disables standby when a particular app is running.

We ran before reports of power usage and can’t wait to run the after reports to see if this makes any difference.

Thanks again to all involved. - John

(imported comment written by dgibson91)

What did you end up doing with the “exists current user” problem? We would also like to deploy power profiles when users are connected via remote desktop.

(imported comment written by SystemAdmin)

dgibson

What did you end up doing with the “exists current user” problem? We would also like to deploy power profiles when users are connected via remote desktop.

We never got an answer or found a real solution. Some systems seem to behave as expected and others seem to get worse and never ever power down.

(imported comment written by dgibson91)

I am going to change it to “exists logged on user” so it is true for remote desktop connections. Hopefully that will won’t cause any conflicts with the way they are setting the power profiles.

(imported comment written by richardzhang91)

We are pleased to announce the release of another set of features and fixes for our Power Management site.

Highlights include:

  • Reporting enhancements: New charts in the Model Power Savings and Power Management Daily Activity State Breakdown reports
  • A Fixlet for curing PC Narcolepsy on Windows Vista/7
  • A more “intelligent” Power Profile Wizard that allows administrators to apply settings changes only if the proposed setting is more aggressive than the current setting
  • A new version of the Store Power Data Utility

Please continue to participate in the forum or email me at richardzhang@us.ibm.com. You feedback is greatly appreciated.

Cheers,

Richard Zhang

Software Engineer

IBM Tivoli Endpoint Management

(imported comment written by richardzhang91)

jspanitz

{quote:title=dgibson}What did you end up doing with the “exists current user” problem? We would also like to deploy power profiles when users are connected via remote desktop.

We never got an answer or found a real solution. Some systems seem to behave as expected and others seem to get worse and never ever power down.{quote}

Hi dgibson and jspanitz, to answer your question, the power profile belongs to the machine in Vista and 7 but

belongs to the user in XP

. So each user in XP has its own power profile. When a XP computer is logged of or is controlled by a remote user, applying the power profile Fixlet will not do anything. Therefore we have to validate “exists current user”.

Cheers,

Richard Zhang

(imported comment written by SystemAdmin)

So if an XP machine has no one logged in, it has no power profile applied and will never go into standby or hibernate, is that correct? Is there a way to place a XP machine with no one logged in in some type of power save mode?

(imported comment written by richardzhang91)

jspanitz

So if an XP machine has no one logged in, it has no power profile applied and will never go into standby or hibernate, is that correct? Is there a way to place a XP machine with no one logged in in some type of power save mode?

When an XP machine is logged off, it will inherit the power profile of the last user. No additional setting is required. It will go to standby or hibernate as usual.

Richard Zhang

Software Engineer

IBM Tivoli Endpoint Management