Allow automatic sleep with Open Network Files (on battery)
Autoriser la veille automatique avec les fichiers réseau ouverts (sur batterie)
Explanation
This policy setting allows you to manage automatic sleep with open network files.
If you enable this policy setting, the computer automatically sleeps when network files are open.
If you disable or do not configure this policy setting, the computer does not automatically sleep when network files are open.
Ce paramètre de stratégie vous permet de gérer la veille automatique avec les fichiers réseau ouverts.
Si vous activez ce paramètre de stratégie, l’ordinateur entre automatiquement en mode veille lorsque des fichiers réseau sont ouverts.
Si vous désactivez ou ne configurez pas ce paramètre, l’ordinateur ne se met pas automatiquement en mode veille lorsque des fichiers réseau sont ouverts.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Power\PowerSettings\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d- 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/AllowSystemSleepWithRemoteFilesOpenDC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d'
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/AllowSystemSleepWithRemoteFilesOpenDC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d'
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/AllowSystemSleepWithRemoteFilesOpenDC
$k = 'HKLM:\Software\Policies\Microsoft\Power\PowerSettings\d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d'
Remove-ItemProperty -Path $k -Name 'DCSettingIndex' -ErrorAction SilentlyContinue