I want to set the Power button action to Turn off the display on multiple computers using a Group Policy. The value is available locally via Control Panel, Power Options but not via the Group Policy Management console.
Microsoft documentation, such as the following article, confirms these are the only group policy options.
Conserving Energy with Group Policy | Microsoft TechNet
Select the Power Button Action (Plugged In):
Specifies the action that Windows takes when a user presses the power
button. Possible actions include Take no action, Sleep, Hibernate,
and Shut Down.
Question: Using a GPO (GPO setting, registry value, or script), how can I set the Power button action to Turn off the display?
Best Answer
Looks like the documentation and GPO just hasn't been updated. There is a value for it at least in powercfg it's just not documented.
Powercfg usage:
And you can set the scheme_GUID to SCHEME_CURRENT so you don't have to query it in your script
There are a list of the GUIDs for options here:
Power Settings
And here are the powercfg usage docs:
Powercfg options
The sub_GUID for power settings is:
SUB_BUTTONS
4f971e89-eebd-4455-a8de-9e59040e7347
And the setting_GUID for the power button is:
PBUTTONACTION
7648efa3-dd9c-4e3e-b566-50f929386280
Setting Index/Values:
0 - Do Nothing
1 - Sleep
2 - Hibernate
3 - Shut Down
4 - Turn off Display - Not documented but tested on my machine, works fine
So you would end up with one of the two below:
OR
And if you want to change it on all plans, you can list all the plans with powercfg /list, recurse through them replacing {scheme_GUID} with the power scheme