Enable Windows to soft-disconnect a computer from a network
Permettre à Windows une déconnexion logicielle d'un ordinateur d'un réseau
Explanation
This policy setting determines whether Windows will soft-disconnect a computer from a network.
If this policy setting is enabled or not configured, Windows will soft-disconnect a computer from a network when it determines that the computer should no longer be connected to a network.
If this policy setting is disabled, Windows will disconnect a computer from a network immediately when it determines that the computer should no longer be connected to a network.
When soft disconnect is enabled:
- When Windows decides that the computer should no longer be connected to a network, it waits for traffic to settle on that network. The existing TCP session will continue uninterrupted.
- Windows then checks the traffic level on the network periodically. If the traffic level is above a certain threshold, no further action is taken. The computer stays connected to the network and continues to use it. For example, if the network connection is currently being used to download files from the Internet, the files will continue to be downloaded using that network connection.
- When the network traffic drops below this threshold, the computer will be disconnected from the network. Apps that keep a network connection active even when they're not actively using it (for example, email apps) might lose their connection. If this happens, these apps should re-establish their connection over a different network.
This policy setting depends on other group policy settings. For example, if 'Minimize the number of simultaneous connections to the Internet or a Windows Domain' is disabled, Windows will not disconnect from any networks.
Ce paramètre de stratégie détermine si Windows va déconnecter par logiciel un ordinateur d’un réseau.
Si vous activez ce paramètre de stratégie ou si vous ne le configurez pas, Windows déconnectera par logiciel un ordinateur d’un réseau lorsqu’il déterminera que l’ordinateur ne doit plus être connecté à un réseau.
Si vous désactivez ce paramètre de stratégie, Windows déconnectera un ordinateur du réseau immédiatement lorsqu’il déterminera que l’ordinateur ne doit plus être connecté à un réseau.
Lorsque la déconnexion logicielle est activée :
– Lorsque Windows décide que l’ordinateur ne doit plus être connecté à un réseau, il attend le trafic pour le régler sur ce réseau. La session TCP existante va continuer sans interruption.
– Windows vérifie régulièrement le niveau de trafic sur le réseau. Si le niveau de trafic est supérieur à un seuil donné, aucune autre action n’est entreprise. L’ordinateur reste connecté au réseau et continue à l’utiliser. Par exemple, si la connexion réseau est actuellement utilisée pour télécharger des fichiers à partir d’Internet, les fichiers continueront à être téléchargés à l’aide de cette connexion réseau.
– Lorsque le trafic réseau chute en dessous de ce seuil, l’ordinateur est déconnecté du réseau. Les applications qui utilisent une connexion réseau active, même lorsqu’elles ne sont pas en cours d’utilisation (par exemple, des applications de messagerie électronique), peuvent perdre leur connexion. Dans ce cas, ces applications doivent rétablir leur connexion via un autre réseau.
Ce paramètre de stratégie dépend d’autres paramètres de stratégie de groupe. Par exemple, si l’opération de réduction du nombre de connexions simultanées à Internet ou à un domaine Windows est désactivée, Windows ne se connecte à aucun réseau.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WcmSvc\GroupPolicy- Value name
fSoftDisconnectConnections
| 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: WCM/WCM_EnableSoftDisconnect
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WcmSvc\GroupPolicy'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'fSoftDisconnectConnections' -Value 1 -Type DWordDisable
# Disable: WCM/WCM_EnableSoftDisconnect
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WcmSvc\GroupPolicy'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'fSoftDisconnectConnections' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": WCM/WCM_EnableSoftDisconnect
$k = 'HKLM:\Software\Policies\Microsoft\Windows\WcmSvc\GroupPolicy'
Remove-ItemProperty -Path $k -Name 'fSoftDisconnectConnections' -ErrorAction SilentlyContinue