Allow antimalware service to remain running always
Autoriser le service anti-programme malveillant à rester constamment actif
Explanation
This policy setting allows you to configure whether or not the antimalware service remains running when antivirus and antispyware security intelligence is disabled. It is recommended that this setting remain disabled.
If you enable this setting, the antimalware service will always remain running even if both antivirus and antispyware security intelligence is disabled.
If you disable or do not configure this setting, the antimalware service will be stopped when both antivirus and antispyware security intelligence is disabled. If the computer is restarted, the service will be started if it is set to Automatic startup. After the service has started, there will be a check to see if antivirus and antispyware security intelligence is enabled. If at least one is enabled, the service will remain running. If both are disabled, the service will be stopped.
Ce paramètre de stratégie vous permet de configurer si le service anti-programme malveillant reste ou non actif lorsque la veille de sécurité anti-espions et la veille de sécurité antivirus sont désactivées. Il est recommandé que ce paramètre reste désactivé.
Si vous activez ce paramètre, le service anti-programme malveillant reste constamment actif même si la veille de sécurité anti-espions et la veille de sécurité antivirus sont toutes deux désactivées.
Si vous désactivez ce paramètre ou que vous ne le configurez pas, le service anti-programme malveillant est arrêté lorsque la veille de sécurité anti-espions et antivirus est désactivée. Si l’ordinateur est redémarré, le service est démarré si son démarrage automatique est défini. Une fois le service démarré, une vérification est effectuée pour déterminer si la veille de sécurité anti-espions et la veille de sécurité antivirus sont activées. Si au moins l’une d’elles est activée, le service reste actif. Si les deux sont désactivées, le service est arrêté.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender- Value name
ServiceKeepAlive
| 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: WindowsDefender/ServiceKeepAlive
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ServiceKeepAlive' -Value 1 -Type DWordDisable
# Disable: WindowsDefender/ServiceKeepAlive
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'ServiceKeepAlive' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": WindowsDefender/ServiceKeepAlive
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender'
Remove-ItemProperty -Path $k -Name 'ServiceKeepAlive' -ErrorAction SilentlyContinue