Allow applications to prevent automatic sleep (plugged in)
Autoriser les applications à empêcher le passage en veille automatique (sur secteur)
Explanation
This policy setting allows applications and services to prevent automatic sleep.
If you enable this policy setting, any application, service, or device driver prevents Windows from automatically transitioning to sleep after a period of user inactivity.
If you disable or do not configure this policy setting, applications, services, or drivers do not prevent Windows from automatically transitioning to sleep. Only user input is used to determine if Windows should automatically sleep.
Ce paramètre de stratégie permet aux applications et aux services d’empêcher la mise en veille automatique.
Si vous activez ce paramètre de stratégie, les applications, les services ou les pilotes de périphérique empêchent Windows de passer automatiquement en veille à la suite d’un délai d’inactivité.
Si vous désactivez ou ne configurez pas ce paramètre, les applications, services ou pilotes n’empêchent pas Windows de passer automatique en veille. Seule l’entrée utilisateur est utilisée pour déterminer si Windows doit passer automatiquement en veille.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2- Value name
ACSettingIndex
| 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/AllowSystemPowerRequestAC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ACSettingIndex' -Value 1 -Type DWordDisable
# Disable: Power/AllowSystemPowerRequestAC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ACSettingIndex' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": Power/AllowSystemPowerRequestAC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\A4B195F5-8225-47D8-8012-9D41369786E2'
Remove-ItemProperty -Path $k -Name 'ACSettingIndex' -ErrorAction SilentlyContinue