Skip to content

Commit 9ef9670

Browse files
authored
Merge branch 'main' into user/zakhter/mde_netfilter_doc_update
2 parents e1e284c + dcf2ae1 commit 9ef9670

File tree

2 files changed

+87
-21
lines changed

2 files changed

+87
-21
lines changed

defender-endpoint/schedule-antivirus-scans-powershell.md

Lines changed: 86 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ms.localizationpriority: medium
66
author: emmwalshh
77
ms.author: ewalsh
88
ms.custom: nextgen
9-
ms.date: 03/26/2025
9+
ms.date: 04/17/2025
1010
ms.reviewer: pauhijbr, ksarens
1111
manager: deniseb
1212
ms.subservice: ngp
@@ -32,32 +32,100 @@ search.appverid: met150
3232

3333
This article describes how to configure scheduled scans using PowerShell cmdlets. To learn more about scheduling scans and about scan types, see [Configure scheduled quick or full Microsoft Defender Antivirus scans](schedule-antivirus-scans.md).
3434

35-
## Use PowerShell cmdlets to schedule scans
35+
## Use PowerShell cmdlets to set the general settings for Scheduled scan and/or On-Demand scan
36+
37+
| Description | Setting|PowerShell cmdlet|
38+
| -------- | -------- | -------- |
39+
|Check for Security Intelligence Updates Before Running Scan |Disabled/Not configured (Default)|Set-MpPreference -CheckForSignaturesBeforeRunningScan `Boolean` <br>For example: Set-MpPreference -CheckForSignaturesBeforeRunningScan $False|
40+
|Randomize Schedule Task Times|Disabled/Not configured (Default)|Set-MpPreference -RandomizeScheduleTaskTimes `Boolean` <br>Example for physical devices: Set-MpPreference -RandomizeScheduleTaskTimes $False <br>Example for Virtual Machines (VMs) or Virtual Desktop Infrastructure (VDIs) or Azure Virtual Desktop (AVD): Set-MpPreference -RandomizeScheduleTaskTimes $True <br>Note: The default randomization time is within an interval of 30 minutes after the specified start time, if the "Scheduler Randomization Time" is also not configured.<br>Note 2: Applies to scheduled scans.|
41+
|Scheduler Randomization Time|0/Not Configured (Default, Scheduled tasks aren't randomized)|Set-MpPreference -SchedulerRandomizationTime `UInt32` <br>For example: Set-MpPreference -SchedulerRandomizationTime 1<br>Note: If Randomize Schedule Task Times is "Not configured" and "Randomize Schedule Task Times" is also set to "Not configured," then the system will use the default behavior within an interval of 30 minutes after the specific start time.<br>Note: If you enable this setting, you must pick a randomization window in hours between 1 and 23. <br>Note 2: Applies to scheduled scans.|
42+
|Avg CPU Load Factor|50/Not Configured (Default)|Set-MpPreference -ScanAvgCPULoadFactor `Byte`<br>For example: Set-MpPreference -ScanAvgCPULoadFactor 50 <br>Note: The default value is 50. The acceptable values are 5 through 100. <br>Note 2: The lower you set it, the longer the scan takes. <br>Note 3: If both ScanOnlyIfIdleEnabled and DisableCpuThrottleOnIdleScans are both enabled, then the value of ScanAvgCPULoadFactor is ignored. <br>Note 4: Applies to scheduled scans.|
43+
|Start the scheduled scan only when device is on but not in use|True/Not Configured (Default)|Set-MpPreference -ScanOnlyIfIdleEnabled `Boolean`<br>For example: Set-MpPreference -ScanOnlyIfIdleEnabled $True <br>Note: Applies to scheduled scans.|
44+
|Disable CPU throttle on idle scans|Enabled/Not Configured (Default)|Set-MpPreference -DisableCpuThrottleOnIdleScans `Boolean`<br>For example: Set-MpPreference -DisableCpuThrottleOnIdleScans $True <br>Idle here means 90% of CPU utilization or below|
45+
|Enable Low CPU Priority|Disabled/Not Configured (Default)|Set-MpPreference -EnableLowCpuPriority `Boolean`<br>For example: Set-MpPreference -EnableLowCpuPriority $False|
46+
|Disable Catchup Quick Scan|Enabled/Not Configured (Default)|Set-MpPreference -DisableCatchupQuickScan `Boolean`<br>For example: Set-MpPreference -DisableCatchupQuickScan $False|
47+
|Disable Catchup Full Scan|Disabled/Not Configured (Default)|Set-MpPreference -DisableCatchupFullScan `Boolean`<br>For example: Set-MpPreference -DisableCatchupFullScan $True|
48+
|Enable full scan on battery power|Disabled/Not Configured (Default)|Set-MpPreference -EnableFullScanOnBatteryPower `Boolean`<br>For example: Set-MpPreference -EnableFullScanOnBatteryPower $False|
49+
50+
For more information, see [Use PowerShell cmdlets to configure and run Microsoft Defender Antivirus](/editor/MicrosoftDocs/defender-docs-pr/defender-endpoint%2Fschedule-antivirus-scans-powershell.md/main/bcb7536e-34b9-8af7-5381-96c46d108a91/use-powershell-cmdlets-microsoft-defender-antivirus.md) and [Defender Antivirus cmdlets](/powershell/module/defender/).
51+
52+
> [!NOTE]
53+
> When you schedule scans for times when endpoints aren't in use, scans don't honor the CPU throttling configuration and will take full advantage of the resources available to complete the scan as fast as possible.
54+
55+
## Use PowerShell cmdlets for scheduling daily quick scans
3656

3757
Use the following cmdlets:
3858

39-
```PowerShell
40-
Set-MpPreference -ScanParameters
41-
Set-MpPreference -ScanScheduleDay
42-
Set-MpPreference -ScanScheduleTime
43-
Set-MpPreference -RandomizeScheduleTaskTimes
4459

60+
```powershell
61+
Set-MpPreference -ScanScheduleQuickScanTime
4562
```
4663

47-
For more information, see [Use PowerShell cmdlets to configure and run Microsoft Defender Antivirus](use-powershell-cmdlets-microsoft-defender-antivirus.md) and [Defender Antivirus cmdlets](/powershell/module/defender/) for more information on how to use PowerShell with Microsoft Defender Antivirus.
64+
> [!NOTE]
65+
> The time value is represented as the number of minutes past midnights (00:00 or 12:00 a.m.), For example, 120 is equivalent to 2:00 AM. The schedule is based on local time on the device where the scan is executing.
4866
49-
## PowerShell cmdlets for scheduling scans when an endpoint isn't in use
67+
For example, to set a daily quick scan run on the Windows clients at 12:00 PM. (720). In this example, we use lunch time, since many devices nowadays are turned off after-hours (For example, laptops and/or tablets).
68+
69+
70+
```powershell
71+
Set-MpPreference -ScanScheduleQuickScanTime 720
72+
```
73+
74+
## Use PowerShell cmdlets to scheduling weekly quick or full scans
5075

5176
Use the following cmdlets:
5277

5378
```PowerShell
54-
Set-MpPreference -ScanOnlyIfIdleEnabled
79+
Set-MpPreference -ScanParameters
80+
Set-MpPreference -ScanScheduleDay
81+
Set-MpPreference -ScanScheduleTime
5582
```
5683

57-
For more information, see [Use PowerShell cmdlets to configure and run Microsoft Defender Antivirus](use-powershell-cmdlets-microsoft-defender-antivirus.md) and [Defender Antivirus cmdlets](/powershell/module/defender/).
84+
-ScanParameters, specifies the scan type to use during a scheduled scan. The acceptable values for this parameter are:
5885

59-
> [!NOTE]
60-
> When you schedule scans for times when endpoints aren't in use, scans don't honor the CPU throttling configuration and will take full advantage of the resources available to complete the scan as fast as possible.
86+
1: Quick scan
87+
88+
2: Full scan
89+
90+
-ScanScheduleDay
91+
92+
Specifies the day of the week on which to perform a scheduled scan. Alternatively, specify everyday for a scheduled scan or never. The acceptable values for this parameter are:
93+
94+
0: Everyday
95+
96+
1: Sunday
97+
98+
2: Monday
99+
100+
3: Tuesday
101+
102+
4: Wednesday
103+
104+
5: Thursday
105+
106+
6: Friday
107+
108+
7: Saturday
109+
110+
8: Never
111+
112+
The default value is 8, never. If you specify a value of 8 or don't specify a value, Windows Defender doesn't perform scheduled scans.
113+
114+
-ScanScheduleTime
115+
116+
Specifies the time of day to run a scheduled scan. The time refers to the local time on the computer. Specify the number of minutes after midnight (for example, enter 60 for AM). This parameter has a default time of two hours after midnight (2 AM).
117+
118+
For example, setting the weekly scheduled scan for a quick scan, that runs every Wednesday at 12:00 PM (lunch time)
119+
120+
121+
```powershell
122+
Set-MpPreference -ScanParameters 1
123+
Set-MpPreference -ScanScheduleDay 4
124+
Set-MpPreference -ScanScheduleTime 720
125+
```
126+
127+
> [!TIP]
128+
> We recommend setting the scheduled scans for a quick scan with Real-Time Protection enabled, Cloud Protection enabled and having the network connectivity to the Cloud Protection backend.
61129
62130
## PowerShell cmdlets for scheduling scans to complete remediation
63131

@@ -68,17 +136,15 @@ Set-MpPreference -RemediationScheduleDay
68136
Set-MpPreference -RemediationScheduleTime
69137
```
70138

71-
See [Use PowerShell cmdlets to configure and run Microsoft Defender Antivirus](use-powershell-cmdlets-microsoft-defender-antivirus.md) and [Defender Antivirus cmdlets](/powershell/module/defender/) for more information on how to use PowerShell with Microsoft Defender Antivirus.
139+
#### See also
72140

73-
## PowerShell cmdlets for scheduling daily scans
141+
[Troubleshoot Microsoft Defender Antivirus scan issues](/defender-endpoint/troubleshoot-mdav-scan-issues)
74142

75-
Use the following cmdlets:
143+
[Use PowerShell cmdlets to configure and manage Microsoft Defender Antivirus](/defender-endpoint/use-powershell-cmdlets-microsoft-defender-antivirus)
76144

77-
```PowerShell
78-
Set-MpPreference -ScanScheduleQuickScanTime
79-
```
145+
[Set the PowerShell cmdlet to configure and manage Microsoft Defender Antivirus](/powershell/module/defender/set-mppreference)
80146

81-
For more information about how to use PowerShell with Microsoft Defender Antivirus, see [Use PowerShell cmdlets to configure and run Microsoft Defender Antivirus](use-powershell-cmdlets-microsoft-defender-antivirus.md) and [Defender Antivirus cmdlets](/powershell/module/defender/).
147+
[Defender Antivirus specific PowerShell functions](/powershell/module/defender)
82148

83149
> [!TIP]
84150
> If you're looking for Antivirus related information for other platforms, see:

defender-xdr/threat-analytics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ms.custom:
2020
- cx-ta
2121
- seo-marvel-apr2020
2222
search.appverid: met150
23-
ms.date: 03/26/2025
23+
ms.date: 04/17/2025
2424
---
2525

2626
# Threat analytics in Microsoft Defender XDR

0 commit comments

Comments
 (0)