Specify the time of day to run a scheduled scan
Spécifier l’heure de la journée à laquelle exécuter une analyse planifiée
Explanation
This policy setting allows you to specify the time of day at which to perform a scheduled scan. The time value is represented as the number of minutes past midnight (00:00). For example, 120 (0x78) is equivalent to 02:00 AM. By default, this setting is set to a time value of 2:00 AM. The schedule is based on local time on the computer where the scan is executing.
If you enable this setting, a scheduled scan will run at the time of day specified.
If you disable or do not configure this setting, a scheduled scan will run at a default time.
Ce paramètre de stratégie vous permet de spécifier l’heure de la journée à laquelle exécuter une analyse planifiée. La valeur de l’heure est représentée sous la forme du nombre de minutes après minuit (00:00). Par exemple, 120 (0x78) est équivalent à 02:00. Par défaut, ce paramètre a la valeur d’heure 02:00. La planification est basée sur l’heure locale de l’ordinateur où l’analyse est exécutée.
Si vous activez ce paramètre, une analyse planifiée est exécutée à l’heure de la journée spécifiée.
Si vous désactivez ou ne configurez pas ce paramètre, une analyse planifiée est exécutée à une heure par défaut.
Registry
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows Defender\Scan- Value name
ScheduleTime
| State | Value written |
|---|---|
| Enabled | not defined in the ADMX (see the options below) |
| Disabled | not defined in the ADMX (see the options below) |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
The ADMX does not specify the value written when enabled; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled). The commands below use 1/0 as an assumption.
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/Scan_ScheduleTime
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Scan'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'ScheduleTime' -Value 1 -Type DWord # assumed value (not defined in the ADMX)
# Specify the time of day to run a scheduled scan
Set-ItemProperty -Path $k -Name 'ScheduleTime' -Value 120 -Type DWord # between 0 and 1440Disable
# Disable: WindowsDefender/Scan_ScheduleTime
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Scan'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# The ADMX does not specify the value written; the GPO editor usually writes REG_DWORD 1 (enabled) / 0 (disabled)
Set-ItemProperty -Path $k -Name 'ScheduleTime' -Value 0 -Type DWord # assumed value (not defined in the ADMX)Revert to "Not configured"
# Revert to "Not configured": WindowsDefender/Scan_ScheduleTime
$k = 'HKLM:\Software\Policies\Microsoft\Windows Defender\Scan'
Remove-ItemProperty -Path $k -Name 'ScheduleTime' -ErrorAction SilentlyContinueOptions (1)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| Specify the time of day to run a scheduled scanSpécifier l’heure de la journée à laquelle exécuter une analyse planifiéeScan_ScheduleTime | Numeric boxdecimal | ScheduleTime | REG_DWORD | Min: 0 · Max: 1440 · Default (UI): 120 |