Select the Sleep button action (plugged in)
Sélectionner l’action du bouton de veille (sur secteur)
Explanation
This policy setting specifies the action that Windows takes when a user presses the sleep button.
Possible actions include:
-Take no action
-Sleep
-Hibernate
-Shut down
If you enable this policy setting, you must select the desired action.
If you disable this policy setting or do not configure it, users can see and change this setting.
Ce paramètre de stratégie spécifie l’action effectuée par Windows lorsqu’un utilisateur appuie sur le bouton de veille.
Les actions possibles sont les suivantes :
-Ne rien faire
-Mettre en veille
-Mettre en veille prolongée
-Arrêter
Si vous activez ce paramètre de stratégie, vous devez sélectionner l’action souhaitée.
Si vous désactivez ce paramètre de stratégie ou si vous ne le configurez pas, les utilisateurs peuvent l’afficher et le modifier.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\96996BC0-AD50-47EC-923B-6F41874DD9EB- Value name
- not defined in the ADMX
Enable / disable values: not defined in the ADMX (see the options below).
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: Power/ACSleepButtonAction_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\96996BC0-AD50-47EC-923B-6F41874DD9EB'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Sleep Button Action
# Possible options:
# Take no action = 0
# Sleep = 1
# Hibernate = 2
# Shut down = 3
Set-ItemProperty -Path $k -Name 'ACSettingIndex' -Value 0 -Type DWordDisable
# Disable: Power/ACSleepButtonAction_2
# No value is written in the "Disabled" state (nothing defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": Power/ACSleepButtonAction_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\96996BC0-AD50-47EC-923B-6F41874DD9EB'
Remove-ItemProperty -Path $k -Name 'ACSettingIndex' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Sleep Button ActionAction du bouton de veilleSelectACSleepButtonAction | Drop-down listenum | ACSettingIndex | REG_DWORD | Required
|