You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Configure Microsoft Defender Antivirus on a remote desktop or virtual desktop infrastructure environment
3
3
description: Get an overview of how to configure Microsoft Defender Antivirus in a remote desktop or non-persistent virtual desktop environment.
4
4
ms.localizationpriority: medium
5
-
ms.date: 10/28/2024
5
+
ms.date: 12/30/2024
6
6
ms.topic: conceptual
7
7
author: denisebmsft
8
8
ms.author: deniseb
@@ -31,19 +31,16 @@ search.appverid: met150
31
31
32
32
- Windows
33
33
34
-
This article is designed for customers who are using Microsoft Defender Antivirus capabilities only. If you have Microsoft Defender for Endpoint (which includes Microsoft Defender Antivirus alongside other device protection capabilities), also go through[Onboard non-persistent virtual desktop infrastructure (VDI) devices in Microsoft Defender XDR](configure-endpoints-vdi.md).
34
+
This article is designed for customers who are using Microsoft Defender Antivirus capabilities only. If you have Microsoft Defender for Endpoint (which includes Microsoft Defender Antivirus alongside other device protection capabilities), see[Onboard non-persistent virtual desktop infrastructure (VDI) devices in Microsoft Defender XDR](configure-endpoints-vdi.md).
35
35
36
-
You can use Microsoft Defender Antivirus in a remote desktop (RDS) or non-persistent virtual desktop infrastructure (VDI) environment. Following the guidance in this article, you can configure updates to download directly to your RDS or VDI environments when a user signs in.
36
+
You can use Microsoft Defender Antivirus in a remote desktop (RDS) or non-persistent virtual desktop infrastructure (VDI) environment. Using the guidance in this article, you can configure updates to download directly to your RDS or VDI environments whenever a user signs in.
37
37
38
38
This guide describes how to configure Microsoft Defender Antivirus on your VMs for optimal protection and performance, including how to:
39
39
40
40
-[Set up a dedicated VDI file share for security intelligence updates](#set-up-a-dedicated-vdi-file-share-for-security-intelligence)
-[Disable scans from occurring after every update](#disable-scans-after-an-update)
45
-
-[Scan out-of-date machines or machines that were offline for a while](#scan-vms-that-have-been-offline)
46
-
-[Apply exclusions](#exclusions)
41
+
-[Download and unpackage the latest updates](#download-and-unpackage-the-latest-updates)
42
+
-[Configure Microsoft Defender Antivirus settings](#microsoft-defender-antivirus-configuration-settings)
43
+
-[Run the Windows Defender Cache Maintenance scheduled task](#run-the-windows-defender-cache-maintenance-scheduled-task)
47
44
48
45
> [!IMPORTANT]
49
46
> Although a VDI can be hosted on Windows Server 2012 or Windows Server 2016, virtual machines (VMs) should be running Windows 10, version 1607 at a minimum, due to increased protection technologies and features that are unavailable in earlier versions of Windows.
@@ -60,27 +57,26 @@ In Windows 10, version 1903, Microsoft introduced the shared security intelligen
60
57
61
58
3. Select **Administrative templates**. Expand the tree to **Windows components** > **Microsoft Defender Antivirus** > **Security Intelligence Updates**.
62
59
63
-
4. Double-click **Define security intelligence location for VDI clients**, and then set the option to **Enabled**.
60
+
4. Double-click **Define security intelligence location for VDI clients**, and then set the option to **Enabled**. A field automatically appears.
64
61
65
-
A field automatically appears.
66
-
67
-
5. Enter `\\<Windows File Server shared location\>\wdav-update` (for help with this value, see [Download and unpackage](#download-and-unpackage-the-latest-updates)).
62
+
5. In the field, type `\\<File Server shared location\>\wdav-update`. (For help with this value, see [Download and unpackage](#download-and-unpackage-the-latest-updates).)
68
63
69
64
6. Select **OK**, and then deploy the Group Policy Object to the VMs you want to test.
70
65
71
66
### PowerShell
72
67
73
68
1. On each RDS or VDI device, use the following cmdlet to enable the feature:
74
69
75
-
`Set-MpPreference -SharedSignaturesPath \\<Windows File Server shared location>\wdav-update`
70
+
`Set-MpPreference -SharedSignaturesPath \\<File Server shared location>\wdav-update`
76
71
77
72
2. Push the update as you normally would push PowerShell-based configuration policies onto your VMs. (See the [Download and unpackage](#download-and-unpackage-the-latest-updates) section in this article. Look for the *shared location* entry.)
78
73
79
74
## Download and unpackage the latest updates
80
75
81
-
Now you can get started on downloading and installing new updates. We've created a sample PowerShell script for you below. This script is the easiest way to download new updates and get them ready for your VMs. You should then set the script to run at a certain time on the management machine by using a scheduled task (or, if you're familiar with using PowerShell scripts in Azure, Intune, or SCCM, you could also use those scripts).
76
+
Now you can get started on downloading and installing new updates. This section contains a sample PowerShell script that you can use. This script is the easiest way to download new updates and get them ready for your VMs. You should then set the script to run at a certain time on the management machine by using a scheduled task. Or, if you're familiar with using PowerShell scripts in Azure, Intune, or Configuration Manager, you could use those scripts instead.
You can set a scheduled task to run once a day so that whenever the package is downloaded and unpacked then the VMs receive the new update. We suggest starting with once a day, but you should experiment with increasing or decreasing the frequency to understand the impact.
@@ -116,7 +113,7 @@ You can also set up your single server or machine to fetch the updates on behalf
116
113
> [!NOTE]
117
114
> An NTFS permission is added for **Authenticated Users:Read:**.
118
115
119
-
For this example, the file share is `\\WindowsFileServer.fqdn\mdatp$\wdav-update`.
116
+
For this example, the file share is `\\FileServer.fqdn\mdatp$\wdav-update`.
120
117
121
118
### Set a scheduled task to run the PowerShell script
122
119
@@ -158,102 +155,171 @@ If you would prefer to do everything manually, here's what to do to replicate th
158
155
> [!NOTE]
159
156
> The VMs will pick up the updated package whenever a new GUID folder is created with an extracted update package or whenever an existing folder is updated with a new extracted package.
160
157
161
-
## Randomize scheduled scans
158
+
## Microsoft Defender Antivirus configuration settings
162
159
163
-
Scheduled scans run in addition to [real-time protection and scanning](configure-real-time-protection-microsoft-defender-antivirus.md).
160
+
It's important to take advantage of the included threat protection capabilities by enabling them with the following recommended configuration settings. It's optimized for VDI environments.
164
161
165
-
The start time of the scan itself is still based on the scheduled scan policy (**ScheduleDay**, **ScheduleTime**, and **ScheduleQuickScanTime**). Randomization causes Microsoft Defender Antivirus to start a scan on each machine within a four-hour window from the time set for the scheduled scan.
162
+
> [!TIP]
163
+
> The latest Windows group policy administrative templates are available in [Create and manage Central Store](/troubleshoot/windows-client/group-policy/create-and-manage-central-store).
166
164
167
-
See [Schedule scans](schedule-antivirus-scans.md) for other configuration options available for scheduled scans.
165
+
### Root
168
166
169
-
## Use quick scans
167
+
- Configure detection for potentially unwanted applications: `Enabled - Block`
170
168
171
-
You can specify the type of scan that should be performed during a scheduled scan. Quick scans are the preferred approach as they're designed to look in all places where malware needs to reside to be active. The following procedure describes how to set up quick scans using Group Policy.
169
+
- Configure local administrator merge behavior for lists: `Disabled`
172
170
173
-
1. In your Group Policy Editor, go to **Administrative templates**\>**Windows components**\>**Microsoft Defender Antivirus**\>**Scan**.
171
+
- Control whether or not exclusions are visible to Local Admins: `Enabled`
174
172
175
-
2. Select **Specify the scan type to use for a scheduled scan** and then edit the policy setting.
173
+
- Turn off routine remediation: `Disabled`
176
174
177
-
3. Set the policy to **Enabled**, and then under **Options**, select **Quick scan**.
175
+
- Randomize scheduled scans: `Enabled`
178
176
179
-
4. Select **OK**.
177
+
### Client Interface
180
178
181
-
5. Deploy your Group Policy object as you usually do.
179
+
- Enable headless UI mode: `Enabled`
182
180
183
-
## Prevent notifications
181
+
> [!NOTE]
182
+
> This policy hides the entire Microsoft Defender Antivirus user interface from end users in your organization.
184
183
185
-
Sometimes, Microsoft Defender Antivirus notifications are sent to or persist across multiple sessions. To help avoid user confusion, you can lock down the Microsoft Defender Antivirus user interface. The following procedure describes how to suppress notifications using Group Policy.
184
+
- Suppress all notifications: `Enabled`
186
185
187
-
1. In your Group Policy Editor, go to **Windows components**\>**Microsoft Defender Antivirus**\>**Client Interface**.
186
+
> [!NOTE]
187
+
> Sometimes, Microsoft Defender Antivirus notifications are sent to or persist across multiple sessions. To help avoid user confusion, you can lock down the Microsoft Defender Antivirus user interface.
188
+
> Suppressing notifications prevents notifications from Microsoft Defender Antivirus from showing up when scans are done or remediation actions are taken. However, your security operations team sees the results of a scan if an attack is detected and stopped. Alerts, such as an initial access alert, are generated, and appear in the [Microsoft Defender portal](https://security.microsoft.com).
188
189
189
-
2. Select **Suppress all notifications** and then edit the policy settings.
190
+
### MAPS
190
191
191
-
3. Set the policy to **Enabled**, and then select **OK**.
192
+
- Join Microsoft MAPS (Turn on cloud-delivered protection): `Enabled - Advanced MAPS`
192
193
193
-
4. Deploy your Group Policy object as you usually do.
194
+
- Send file samples when further analysis is required: `Send all samples (more secure)` or `Send safe sample (less secure)`
194
195
195
-
Suppressing notifications prevents notifications from Microsoft Defender Antivirus from showing up when scans are done or remediation actions are taken. However, your security operations team sees the results of a scan if an attack is detected and stopped. Alerts, such as an initial access alert, are generated, and appear in the [Microsoft Defender portal](https://security.microsoft.com).
196
+
### MPEngine
196
197
197
-
## Disable scans after an update
198
+
- Configure extended cloud check: `20`
198
199
199
-
Disabling a scan after an update prevents a scan from occurring after receiving an update. You can apply this setting when creating the base image if you have also run a quick scan. This way, you can prevent the newly updated VM from performing a scan again (as you've already scanned it when you created the base image).
200
+
- Select cloud protection level: `Enabled - High`
200
201
201
-
> [!IMPORTANT]
202
-
> Running scans after an update helps ensure your VMs are protected with the latest security intelligence updates. Disabling this option reduces the protection level of your VMs and should only be used when first creating or deploying the base image.
202
+
- Enable file hash computation feature: `Enabled`
203
203
204
-
1. In your Group Policy Editor, go to **Windows components**\>**Microsoft Defender Antivirus**\>**Security Intelligence Updates**.
204
+
> [!NOTE]
205
+
> "Enable file hash computation feature" is only needed if using Indicators – File hash. It can cause higher amount of CPU utilization, since it has to parse thru each binary on disk to get the file hash.
205
206
206
-
2. Select **Turn on scan after security intelligence update** and then edit the policy setting.
207
+
### Real-time protection
207
208
208
-
3. Set the policy to **Disabled**.
209
+
- Configure monitoring for incoming and outgoing file and program activity: `Enabled – bi-directional (full on-access)`
209
210
210
-
4. Select **OK**.
211
+
- Monitor file and program activity on your computer: `Enabled`
211
212
212
-
5. Deploy your Group Policy object as you usually do.
213
+
- Scan all downloaded files and attachments: `Enabled`
213
214
214
-
This policy prevents a scan from running immediately after an update.
215
+
- Turn on behavior monitoring: `Enabled`
215
216
216
-
## Disable the `ScanOnlyIfIdle` option
217
+
- Turn on process scanning whenever real-time protection is enabled: `Enabled`
217
218
218
-
Use the following cmdlet, to stop a quick or scheduled scan whenever the device goes idle if it is in passive mode.
219
+
- Turn on raw volume write notifications: `Enabled`
219
220
220
-
```PowerShell
221
-
Set-MpPreference -ScanOnlyIfIdleEnabled $false
222
-
```
221
+
### Scans
222
+
223
+
- Check for the latest virus and spyware security intelligence before running a scheduled scan: `Enabled`
224
+
225
+
- Scan archive files: `Enabled`
226
+
227
+
- Scan network files: `Not configured`
228
+
229
+
- Scan packed executables: `Enabled`
230
+
231
+
- Scan removable drives: `Enabled`
232
+
233
+
- Turn on catch-up full scan (Disable catch-up full scan): `Not configured`
> If you want to harden, you could change "Turn on catch-up quick scan" to enabled, which will help when VMs have been offline, and have missed two or more consecutive scheduled scans. But since it is running a scheduled scan, it will use additional CPU.
239
+
240
+
- Turn on e-mail scanning: `Enabled`
241
+
242
+
- Turn on heuristics: `Enabled`
243
+
244
+
- Turn on reparse point scanning: `Enabled`
245
+
246
+
#### General scheduled scan settings
247
+
248
+
- Configure low CPU priority for scheduled scans (Use low CPU priority for scheduled scans): `Not configured`
249
+
250
+
- Specify the maximum percentage of CPU utilization during a scan (CPU usage limit per scan): `50`
223
251
224
-
You can also disable the `ScanOnlyIfIdle` option in Microsoft Defender Antivirus by configuration via local or domain group policy. This setting prevents significant CPU contention in high density environments.
252
+
- Start the scheduled scan only when computer is on but not in use (ScanOnlyIfIdle): `Not configured`
225
253
226
-
For more information, see [Start the scheduled scan only when computer is on but not in use](https://admx.help/?Category=SystemCenterEndpointProtection&Policy=Microsoft.Policies.Antimalware::scan_scanonlyifidle).
254
+
- Use the following cmdlet, to stop a quick or scheduled scan whenever the device goes idle if it is in passive mode.
227
255
228
-
## Scan VMs that have been offline
256
+
```powershell
229
257
230
-
1. In your Group Policy Editor, go to **Windows components**\>**Microsoft Defender Antivirus**\>**Scan**.
258
+
Set-MpPreference -ScanOnlyIfIdleEnabled $false
231
259
232
-
2. Select **Turn on catch-up quick scan** and then edit the policy setting.
260
+
```
261
+
262
+
> [!TIP]
263
+
> The setting, "Start the scheduled scan only when computer is on but not in use" prevents significant CPU contention in high-density environments.
264
+
265
+
#### Daily quick scan
266
+
267
+
- Specify the interval to run quick scans per day: `Not configured`
268
+
269
+
- Specify the time for a daily quick scan (Run daily quick scan at): `12 PM`
270
+
271
+
#### Run a weekly scheduled scan (quick or full)
272
+
273
+
- Specify the scan type to use for a scheduled scan (Scan type): `Not configured`
274
+
275
+
- Specify the time of day to run a scheduled scan (Day of week to run scheduled scan): `Not configured`
276
+
277
+
- Specify the day of the week to run a scheduled scan (Time of day to run a scheduled scan): `Not configured`
278
+
279
+
### Security Intelligence Updates
280
+
281
+
- Turn on scan after security intelligence update (Disable scans after an update): `Disabled`
233
282
234
-
3. Set the policy to **Enabled**.
283
+
> [!NOTE]
284
+
> Disabling a scan after a security intelligence update prevents a scan from occurring after receiving an update. You can apply this setting when creating the base image if you have also run a quick scan. This way, you can prevent the newly updated VM from performing a scan again (as you've already scanned it when you created the base image).
285
+
286
+
> [!IMPORTANT]
287
+
> Running scans after an update helps ensure your VMs are protected with the latest security intelligence updates. Disabling this option reduces the protection level of your VMs and should only be used when first creating or deploying the base image.
288
+
289
+
- Specify the interval to check for security intelligence updates (Enter how often to check for security intelligence updates): `Enabled - 8`
290
+
291
+
- Leave other settings in their default state
292
+
293
+
### Threats
294
+
295
+
- Specify threat alert levels at which default action shouldn't be taken when detected: `Enabled`
235
296
236
-
4. Select **OK**.
297
+
- Set `Severe (5)`, `High (4)`, `Medium (2)`, and `Low (1)` all to `Quarantine (2)`, as shown in the following table:
237
298
238
-
5. Deploy your Group Policy Object as you usually do.
299
+
|Value name|Value |
300
+
| -------- | -------- |
301
+
|`1` (Low) |`2`|
302
+
|`2` (Medium) |`2`|
303
+
|`4` (High) |`2`|
304
+
|`5` (Severe) |`2`|
239
305
240
-
This policy forces a scan if the VM missed two or more consecutive scheduled scans.
306
+
### Attack surface reduction rules
241
307
242
-
## Enable headless UI mode
308
+
Configure all available rules to `Audit`.
243
309
244
-
1. In your Group Policy Editor, go to **Windows components**\>**Microsoft Defender Antivirus**\>**Client Interface**.
310
+
### Enable network protection
245
311
246
-
2. Select **Enable headless UI mode** and edit the policy.
312
+
Prevent users and apps from accessing dangerous websites (Enable network protection): `Enabled - Audit mode`.
247
313
248
-
3. Set the policy to **Enabled**.
314
+
### SmartScreen for Microsoft Edge
249
315
250
-
4. Select **OK**.
316
+
- Require SmartScreen for Microsoft Edge: `Yes`
251
317
252
-
5. Deploy your Group Policy Object as you usually do.
318
+
- Block malicious site access: `Yes`
253
319
254
-
This policy hides the entire Microsoft Defender Antivirus user interface from end users in your organization.
320
+
- Block unverified file download: `Yes`
255
321
256
-
## Run the "Windows Defender Cache Maintenance" scheduled task
322
+
## Run the Windows Defender Cache Maintenance scheduled task
257
323
258
324
Optimize the "Windows Defender Cache Maintenance" scheduled task for non-persistent and/or persistent VDI environments. Run this task on the main image before sealing.
259
325
@@ -263,10 +329,21 @@ Optimize the "Windows Defender Cache Maintenance" scheduled task for non-persist
263
329
264
330
3. Select **Run**, and let the scheduled task finish.
265
331
266
-
## Exclusions
332
+
> [!WARNING]
333
+
> If you do not do this, it can cause higher cpu utilization while the cache maintenance task is running on each of the VMs.
334
+
335
+
### Enable tamper protection
336
+
337
+
Enable tamper protection to prevent Microsoft Defender Antivirus from being disabled in the [Microsoft Defender portal](https://security.microsoft.com).
338
+
339
+
### Exclusions
267
340
268
341
If you think you need to add exclusions, see [Manage exclusions for Microsoft Defender for Endpoint and Microsoft Defender Antivirus](defender-endpoint-antivirus-exclusions.md).
269
342
343
+
## Next step
344
+
345
+
If you're also deploying [endpoint detection and response](overview-endpoint-detection-response.md) (EDR) to your Windows-based VDI VMs, see [Onboard non-persistent virtual desktop infrastructure (VDI) devices in Microsoft Defender XDR](/defender-endpoint/configure-endpoints-vdi).
346
+
270
347
## See also
271
348
272
349
-[Tech Community Blog: Configuring Microsoft Defender Antivirus for non-persistent VDI machines](https://techcommunity.microsoft.com/t5/microsoft-defender-for-endpoint/configuring-microsoft-defender-antivirus-for-non-persistent-vdi/ba-p/1489633)
0 commit comments