Skip to content

Commit ce522e9

Browse files
authored
Merge pull request #2272 from YongRhee-MSFT/docs-editor/deployment-vdi-microsoft-defen-1735251536
Update deployment-vdi-microsoft-defender-antivirus.md
2 parents c3aee36 + d8565c3 commit ce522e9

File tree

1 file changed

+144
-67
lines changed

1 file changed

+144
-67
lines changed

defender-endpoint/deployment-vdi-microsoft-defender-antivirus.md

Lines changed: 144 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Configure Microsoft Defender Antivirus on a remote desktop or virtual desktop infrastructure environment
33
description: Get an overview of how to configure Microsoft Defender Antivirus in a remote desktop or non-persistent virtual desktop environment.
44
ms.localizationpriority: medium
5-
ms.date: 10/28/2024
5+
ms.date: 12/30/2024
66
ms.topic: conceptual
77
author: denisebmsft
88
ms.author: deniseb
@@ -31,19 +31,16 @@ search.appverid: met150
3131

3232
- Windows
3333

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).
3535

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.
3737

3838
This guide describes how to configure Microsoft Defender Antivirus on your VMs for optimal protection and performance, including how to:
3939

4040
- [Set up a dedicated VDI file share for security intelligence updates](#set-up-a-dedicated-vdi-file-share-for-security-intelligence)
41-
- [Randomize scheduled scans](#randomize-scheduled-scans)
42-
- [Use quick scans](#use-quick-scans)
43-
- [Prevent notifications](#prevent-notifications)
44-
- [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)
4744

4845
> [!IMPORTANT]
4946
> 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
6057

6158
3. Select **Administrative templates**. Expand the tree to **Windows components** > **Microsoft Defender Antivirus** > **Security Intelligence Updates**.
6259

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.
6461

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).)
6863

6964
6. Select **OK**, and then deploy the Group Policy Object to the VMs you want to test.
7065

7166
### PowerShell
7267

7368
1. On each RDS or VDI device, use the following cmdlet to enable the feature:
7469

75-
`Set-MpPreference -SharedSignaturesPath \\<Windows File Server shared location>\wdav-update`
70+
`Set-MpPreference -SharedSignaturesPath \\<File Server shared location>\wdav-update`
7671

7772
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.)
7873

7974
## Download and unpackage the latest updates
8075

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.
8277

8378
```PowerShell
79+
8480
$vdmpathbase = "$env:systemdrive\wdav-update\{00000000-0000-0000-0000-"
8581
$vdmpathtime = Get-Date -format "yMMddHHmmss"
8682
$vdmpath = $vdmpathbase + $vdmpathtime + '}'
@@ -91,6 +87,7 @@ New-Item -ItemType Directory -Force -Path $vdmpath | Out-Null
9187
Invoke-WebRequest -Uri 'https://go.microsoft.com/fwlink/?LinkID=121721&arch=x64' -OutFile $vdmpackage
9288
9389
Start-Process -FilePath $vdmpackage -WorkingDirectory $vdmpath -ArgumentList "/x"
90+
9491
```
9592

9693
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
116113
> [!NOTE]
117114
> An NTFS permission is added for **Authenticated Users:Read:**.
118115
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`.
120117

121118
### Set a scheduled task to run the PowerShell script
122119

@@ -158,102 +155,171 @@ If you would prefer to do everything manually, here's what to do to replicate th
158155
> [!NOTE]
159156
> 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.
160157
161-
## Randomize scheduled scans
158+
## Microsoft Defender Antivirus configuration settings
162159

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.
164161

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).
166164
167-
See [Schedule scans](schedule-antivirus-scans.md) for other configuration options available for scheduled scans.
165+
### Root
168166

169-
## Use quick scans
167+
- Configure detection for potentially unwanted applications: `Enabled - Block`
170168

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`
172170

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`
174172

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`
176174

177-
3. Set the policy to **Enabled**, and then under **Options**, select **Quick scan**.
175+
- Randomize scheduled scans: `Enabled`
178176

179-
4. Select **OK**.
177+
### Client Interface
180178

181-
5. Deploy your Group Policy object as you usually do.
179+
- Enable headless UI mode: `Enabled`
182180

183-
## Prevent notifications
181+
> [!NOTE]
182+
> This policy hides the entire Microsoft Defender Antivirus user interface from end users in your organization.
184183
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`
186185

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).
188189
189-
2. Select **Suppress all notifications** and then edit the policy settings.
190+
### MAPS
190191

191-
3. Set the policy to **Enabled**, and then select **OK**.
192+
- Join Microsoft MAPS (Turn on cloud-delivered protection): `Enabled - Advanced MAPS`
192193

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)`
194195

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
196197

197-
## Disable scans after an update
198+
- Configure extended cloud check: `20`
198199

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`
200201

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`
203203

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.
205206
206-
2. Select **Turn on scan after security intelligence update** and then edit the policy setting.
207+
### Real-time protection
207208

208-
3. Set the policy to **Disabled**.
209+
- Configure monitoring for incoming and outgoing file and program activity: `Enabled – bi-directional (full on-access)`
209210

210-
4. Select **OK**.
211+
- Monitor file and program activity on your computer: `Enabled`
211212

212-
5. Deploy your Group Policy object as you usually do.
213+
- Scan all downloaded files and attachments: `Enabled`
213214

214-
This policy prevents a scan from running immediately after an update.
215+
- Turn on behavior monitoring: `Enabled`
215216

216-
## Disable the `ScanOnlyIfIdle` option
217+
- Turn on process scanning whenever real-time protection is enabled: `Enabled`
217218

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`
219220

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`
234+
235+
- Turn on catch-up quick scan (Disable catchup quick scan): `Not configured`
236+
237+
> [!NOTE]
238+
> 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`
223251

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`
225253

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.
227255

228-
## Scan VMs that have been offline
256+
```powershell
229257
230-
1. In your Group Policy Editor, go to **Windows components** \> **Microsoft Defender Antivirus** \> **Scan**.
258+
Set-MpPreference -ScanOnlyIfIdleEnabled $false
231259
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`
233282

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`
235296

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:
237298

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`|
239305

240-
This policy forces a scan if the VM missed two or more consecutive scheduled scans.
306+
### Attack surface reduction rules
241307

242-
## Enable headless UI mode
308+
Configure all available rules to `Audit`.
243309

244-
1. In your Group Policy Editor, go to **Windows components** \> **Microsoft Defender Antivirus** \> **Client Interface**.
310+
### Enable network protection
245311

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`.
247313

248-
3. Set the policy to **Enabled**.
314+
### SmartScreen for Microsoft Edge
249315

250-
4. Select **OK**.
316+
- Require SmartScreen for Microsoft Edge: `Yes`
251317

252-
5. Deploy your Group Policy Object as you usually do.
318+
- Block malicious site access: `Yes`
253319

254-
This policy hides the entire Microsoft Defender Antivirus user interface from end users in your organization.
320+
- Block unverified file download: `Yes`
255321

256-
## Run the "Windows Defender Cache Maintenance" scheduled task
322+
## Run the Windows Defender Cache Maintenance scheduled task
257323

258324
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.
259325

@@ -263,10 +329,21 @@ Optimize the "Windows Defender Cache Maintenance" scheduled task for non-persist
263329

264330
3. Select **Run**, and let the scheduled task finish.
265331

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
267340

268341
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).
269342

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+
270347
## See also
271348

272349
- [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

Comments
 (0)