Turn on the ability for applications to prevent sleep transitions (on battery)
Activer la capacité des applications à empêcher le passage en veille (sur batterie)
Explanation
This policy setting allows you to turn on the ability for applications and services to prevent the system from sleeping.
If you enable this policy setting, an application or service may prevent the system from sleeping (Hybrid Sleep, Stand By, or Hibernate).
If you disable or do not configure this policy setting, users control this setting.
Ce paramètre de stratégie vous permet d’activer la capacité, pour les applications et services, à empêcher le système de basculer en mode Veille.
Si vous activez ce paramètre de stratégie, une application ou un service peut empêcher le système de se mettre en veille (Veille hybride, Veille ou Veille prolongée).
Si vous désactivez ou ne configurez pas ce paramètre de stratégie, les utilisateurs contrôlent ce paramètre.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\B7A27025-E569-46c2-A504-2B96CAD225A1- Value name
DCSettingIndex
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
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/DCCriticalSleepTransitionsDisable_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\B7A27025-E569-46c2-A504-2B96CAD225A1'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DCSettingIndex' -Value 1 -Type DWordDisable
# Disable: Power/DCCriticalSleepTransitionsDisable_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\B7A27025-E569-46c2-A504-2B96CAD225A1'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'DCSettingIndex' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Power/DCCriticalSleepTransitionsDisable_2
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\B7A27025-E569-46c2-A504-2B96CAD225A1'
Remove-ItemProperty -Path $k -Name 'DCSettingIndex' -ErrorAction SilentlyContinue