Azure Lesson 71 of 137

Deploying Microsoft Defender for Endpoint: Onboarding, ASR Rules, and EDR in Block Mode

Microsoft Defender for Endpoint (MDE) is the EDR/EPP that backs the Microsoft Defender XDR portal. Buying the license does almost nothing on its own — the value comes from getting devices onboarded, hardening the attack surface, and letting the platform respond automatically. This guide walks the rollout I run on Windows fleets: onboard via Intune, tune ASR in audit-first, then enable EDR in block mode and AIR.

In a nutshell

Think of EDR — Endpoint Detection and Response — as a security camera plus an immune system installed on every laptop and server. The camera never stops recording: every process that launches, every file written, every network connection is logged. The immune system watches that footage in real time, recognises the signature of an intrusion — a Word document spawning PowerShell, a strange process reaching into lsass.exe to steal passwords — and can act on its own: quarantine the malicious file, kill the process, and if things look bad enough, slam the device into isolation so it can’t infect the rest of the fleet. Microsoft Defender for Endpoint (MDE) is Microsoft’s version of that camera-plus-immune-system, and this lesson is about rolling it out across a Windows estate the way a security team actually does it.

The trap beginners fall into is thinking the licence is the protection. It isn’t. Buying Microsoft 365 E5 gives you the right to run MDE, but a device only starts recording once it’s onboarded, only blocks bad behaviour once you’ve turned on the attack-surface controls, and only heals itself once you’ve set an automation level. The whole rollout is three deliberate moves: get the sensor onboarded, harden the surface (in audit mode first, always), then let the platform respond automatically — with a human in the loop until you trust it.

Level: Advanced · Time: ~39 min

Before you start, you should be comfortable with:

After this lesson you’ll be able to:

Defender for Endpoint: onboard → EDR sensor → cloud detections → automated remediation

Read left to right: you onboard each Windows client and server so it carries the MsSense sensor; the sensor records behaviour and enforces next-gen AV plus ASR locally; the cloud backend verdicts suspicious files and raises alerts; Automated Investigation & Response quarantines, kills, or isolates; and every signal rolls up into the Defender XDR portal and Microsoft Sentinel for the SOC to hunt across.

1. Licensing and the two plans

MDE ships in two SKUs, and the difference matters for what you can actually configure:

Capability Plan 1 Plan 2
Next-gen antivirus, ASR rules, device control Yes Yes
Manual response (isolate, restrict, AV scan) Yes Yes
EDR with behavioral detections Limited Full
Automated Investigation & Response (AIR) No Yes
Threat & Vulnerability Management (Defender TVM) No Yes
Advanced hunting, custom detections No Yes

Plan 2 is included in Microsoft 365 E5, E5 Security, and Windows E5. ASR rules and tamper protection work on Plan 1, but EDR in block mode, AIR, TVM, and custom detection rules — most of this article — require Plan 2. Confirm your entitlement before you design around features you can’t enforce.

2. Onboarding paths

Every device sends telemetry only after it’s onboarded. There are three mechanisms; pick by how the device is managed.

Path Best for Mechanism
Intune / MDM Cloud-managed Windows clients Endpoint security policy or auto-onboard via Defender connector
Group Policy / Config Mgr Domain-joined, on-prem servers Onboarding script + scheduled task or ConfigMgr collection
Local script Pilots, test rings, one-offs WindowsDefenderATPOnboardingScript.cmd from Settings

Connect Intune to Defender first

In the Microsoft Defender portal (security.microsoft.com) go to Settings -> Endpoints -> Advanced features and turn on Microsoft Intune connection. Mirror it in Intune at Endpoint security -> Microsoft Defender for Endpoint by setting Allow Microsoft Defender for Endpoint to enforce Endpoint Security Configurations to On. This lets Intune push onboarding without distributing a script.

Onboard Windows clients via Intune

Create an EDR policy under Endpoint security -> Endpoint detection and response:

Intune admin center -> Endpoint security -> Endpoint detection and response -> Create Policy
  Platform: Windows
  Profile:  Endpoint detection and response
  Settings:
    Microsoft Defender for Endpoint client configuration package type: Auto from connector
    Sample sharing for all files: All
    Expedite telemetry reporting frequency: Yes (for high-value devices)
  Assign: your "MDE - Pilot Ring" device group

With the connector live, the onboarding blob is injected automatically — you don’t paste a package. Devices appear in the Defender portal device inventory within minutes of the policy applying.

Onboard servers

Windows Server 2019/2022/2025 onboard like clients through Intune, Defender for Cloud, or the script. For Server 2012 R2 / 2016, use the modern, unified MDE solution (the standalone installer md4ws.msi) rather than the legacy MMA/SCEP agent, which is retired:

# Run elevated on Windows Server 2012 R2 / 2016
msiexec /i md4ws.msi /quiet

# Then onboard with the server-specific local script from
# Defender portal -> Settings -> Endpoints -> Onboarding -> "Windows Server 2012 R2 and 2016"
.\WindowsDefenderATPLocalOnboardingScript.cmd

The cleanest path for Azure VMs is to let Microsoft Defender for Cloud auto-provision the MDE extension when you enable the Servers plan — no per-VM script.

Verify onboarding from the host

# Connectivity + onboarding state (run elevated)
Get-MpComputerStatus | Select-Object AMRunningMode, AMServiceEnabled, RealTimeProtectionEnabled

# Onboarding flag in the registry (1 = onboarded)
Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status' -Name OnboardingState

AMRunningMode should read Normal (Defender is the active AV) or EDR Block Mode once that’s enabled. If you see Passive, a third-party AV is primary — that’s fine for EDR but ASR and next-gen protection won’t fully enforce until Defender is in active or block mode.

3. Next-gen protection settings

Before hardening the attack surface, get the antivirus engine configured correctly. Push these through an Antivirus policy in Endpoint security -> Antivirus -> Windows.

The settings that actually move the needle:

# Equivalent local config (Intune is the source of truth in production)
Set-MpPreference -MAPSReporting Advanced
Set-MpPreference -SubmitSamplesConsent SendSafeSamples
Set-MpPreference -CloudBlockLevel High
Set-MpPreference -CloudExtendedTimeout 50
# Tamper protection is enforced via Intune/portal, not Set-MpPreference

Tamper protection is non-negotiable. Turn it on tenant-wide early. Once on, attackers can’t Set-MpPreference -DisableRealtimeMonitoring $true their way past you, and neither can a curious admin.

4. Attack Surface Reduction rules — audit first

ASR rules block the behaviors malware relies on: Office spawning child processes, credential theft from LSASS, script-launched executables, and more. Each rule has three states — Not configured (0), Block (1), and Audit (2) — plus Warn (6) for a subset.

The cardinal rule: deploy in Audit first. ASR rules can break legitimate line-of-business apps and macros. Run audit for one to two weeks, review what would have been blocked, exclude the false positives, then flip to Block.

Configure ASR via Endpoint security -> Attack surface reduction -> Create Policy -> Attack Surface Reduction Rules. Start with this high-value set, all in Audit:

Rule GUID Notes
Block credential stealing from LSASS 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 High value, low breakage
Block Office apps creating child processes d4f940ab-401b-4efc-aadc-ad5f3c50688a Watch macro-heavy apps
Block Office from creating executable content 3b576869-a4ec-4529-8536-b80a7769e899
Block executable content from email/webmail be9ba2d9-53ea-4cdc-84e5-9b1eeee46550
Block JS/VBS from launching downloaded content d3e037e1-3eb8-44c8-a917-57927947596d
Block process creations from PSExec and WMI d1e49aac-8f56-4280-b9ba-993a6d77406c Can hit ConfigMgr/RMM tooling
Block persistence via WMI event subscription e6db77e5-3df2-4cf1-b95a-636979351e5b No audit mode; deploy as Block
Block untrusted/unsigned processes from USB b2b3f03d-6a65-4f7b-a9c7-1c7ef74a9ba4

The same rules can go through PowerShell for a pilot box:

# Set the LSASS rule to Audit (2). 1 = Block, 6 = Warn, 0 = Off
Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 `
                -AttackSurfaceReductionRules_Actions Enabled   # Enabled = Block

# Confirm current rule states
Get-MpPreference | Select-Object -ExpandProperty AttackSurfaceReductionRules_Ids
Get-MpPreference | Select-Object -ExpandProperty AttackSurfaceReductionRules_Actions

A handful of rules (WMI persistence is the classic example) have no audit mode. Validate those on a small pilot ring before broad deployment, since you can’t preview their impact passively.

Reviewing audit results

After a week, query what the rules caught using advanced hunting in the Defender portal:

DeviceEvents
| where Timestamp > ago(7d)
| where ActionType startswith "Asr"
| summarize Count = count() by ActionType, FileName, FolderPath
| order by Count desc

ActionType ending in Audited is what would have been blocked. Add path or certificate exclusions for the legitimate hits, then change those rules to Block.

5. Web content filtering, controlled folder access, network protection

Three more attack-surface controls, all in the Attack surface reduction policy area.

Network protection must be enabled (block mode) for web content filtering and web threat protection to enforce — in audit mode they only log. Set it via the ASR policy or:

Set-MpPreference -EnableNetworkProtection Enabled   # Disabled | AuditMode | Enabled

Web content filtering is configured in the portal at Settings -> Endpoints -> Web content filtering: build policies that block categories (gambling, malware, newly registered domains) and scope them to device groups. It rides on Network protection, so enable that first.

Controlled folder access (CFA) is targeted ransomware protection — it blocks untrusted processes from writing to protected folders (Documents, Desktop, and any you add). Like ASR, start in Audit, because CFA frequently blocks legitimate apps that write to user folders:

Set-MpPreference -EnableControlledFolderAccess AuditMode
Add-MpPreference -ControlledFolderAccessAllowedApplications "C:\Apps\lob-tool.exe"

Review CFA audit events, allow the legit apps explicitly, then move to Enabled.

6. EDR in block mode and AIR

EDR in block mode

EDR in block mode lets MDE remediate post-breach artifacts that the primary antivirus missed — even when a third-party AV is your active product and Defender is in passive mode. It is not a replacement for real-time protection; it’s the safety net behind it. Enable it once, tenant-wide:

Defender portal -> Settings -> Endpoints -> Advanced features
  Enable EDR in block mode: On

After it applies, Get-MpComputerStatus reports AMRunningMode: EDR Block Mode on passive-AV machines. On machines where Defender is already the active AV, you get the protection inherently.

Automated Investigation & Response

AIR is the force multiplier: when an alert fires, MDE automatically investigates the device, correlates artifacts, and can remediate (quarantine files, kill processes, remove persistence) without an analyst. Configure the automation level per device group:

Defender portal -> Settings -> Endpoints -> Device groups -> (group) -> Edit
  Automation level: Full - remediate threats automatically

Levels run from No automated response up to Full - remediate threats automatically. Start pilot/server groups at Semi - require approval for any remediation so you can see AIR’s reasoning, then graduate well-understood client groups to Full. Review the work under Incidents & alerts -> Investigations, where each automated investigation shows the entities examined and the verdict.

7. Device discovery and Defender TVM

Device discovery uses your onboarded endpoints as sensors to find unmanaged devices on the same network — the rogue NAS, the unpatched printer, the shadow-IT laptop. Set it to Standard discovery under Settings -> Endpoints -> Device discovery; unmanaged devices then surface in the inventory so you can onboard or isolate them.

Threat & Vulnerability Management (Defender TVM, Plan 2) continuously inventories software and surfaces CVEs and misconfigurations, rolled up into an exposure score (lower is better) and a Microsoft Secure Score for Devices. The actionable view is Vulnerability management -> Recommendations, sorted by exposure impact. From there you can push a remediation request straight into Intune as a task — closing the loop between “you have this CVE” and “here’s the deployment that fixes it.”

8. Custom detection rules and live response

Custom detection rules turn an advanced-hunting KQL query into a scheduled detection that raises alerts and can trigger response actions. Example — flag LSASS access by an unusual process:

DeviceProcessEvents
| where Timestamp > ago(1h)
| where InitiatingProcessFileName !in~ ("lsass.exe", "MsMpEng.exe", "csrss.exe", "wininit.exe")
| where FileName =~ "rundll32.exe" and ProcessCommandLine has "comsvcs.dll"
| project Timestamp, DeviceId, DeviceName, InitiatingProcessFileName, FileName, ProcessCommandLine

Save it via Advanced hunting -> (run query) -> Create detection rule: set frequency, severity, the impacted entities, and an automated action such as Isolate device or Collect investigation package.

Live response gives an analyst a remote shell to the device for hands-on triage. Enable it under Advanced features (and Live response for servers separately). The session is fully audited:

# In a live response session (Defender portal -> device -> Initiate live response)
getfile C:\Users\Public\suspicious.exe     # pull an artifact to the portal
processes                                  # list running processes
analyze file C:\Users\Public\suspicious.exe  # detonate/inspect
remediate file C:\Users\Public\suspicious.exe

Enterprise scenario

A logistics company moved its ASR set from Audit to Block for a 9,000-seat fleet and within an hour the service desk was buried: the warehouse management thick client and a finance VBA add-in both stopped launching. The culprit was d4f940ab-401b-4efc-aadc-ad5f3c50688a (Block Office apps from creating child processes) and 3b576869-a4ec-4529-8536-b80a7769e899 (Block Office from creating executable content). The team had run audit, but only queried the last 7 days — month-end finance macros that triggered the add-in had never executed during the audit window, so the breakage was invisible until enforcement.

The fix was twofold. First, widen the audit lookback and pivot on the rule GUID, not just ActionType, to catch low-frequency offenders before flipping anything:

DeviceEvents
| where Timestamp > ago(45d)
| where ActionType == "AsrOfficeChildProcessAudited"
| summarize Hits = count(), Devices = dcount(DeviceId), Last = max(Timestamp)
    by FolderPath, InitiatingProcessFileName
| order by Hits desc

Second, instead of disabling the rules, they scoped a per-app exception with the dedicated ASR exclusion setting (not the AV exclusion list, which ASR ignores for these rules), keeping the rules in Block everywhere else:

Add-MpPreference -AttackSurfaceReductionOnlyExclusions "C:\Apps\WMS\wms.exe"

The lesson the platform team wrote into their runbook: an ASR audit is only as good as its longest business cycle. For anything finance- or quarter-end-driven, audit through at least one month-end close before enforcing, and review by GUID and folder path rather than eyeballing aggregate counts.

Going deeper

The eight steps above are the rollout. This section is the layer underneath them — what the sensor actually is, how the cloud verdict is reached, how policies collide, and where the platform’s data lives. It’s the difference between running the wizard and being able to debug it at 2 a.m.

What “the sensor” actually is

There is no single “MDE agent” you install on Windows 10/11 or Server 2019+. The EDR sensor is built into the operating system and is switched on by onboarding, which flips registry keys under HKLM\SOFTWARE\Microsoft\Windows Advanced Threat Protection (the OnboardingState and OrgId values). The moving parts you’ll see in Task Manager and services.msc:

Component Process / service Job
EDR sensor MsSense.exe (service Sense) Records process/file/network/registry events, streams them to the cloud
Cloud comms SenseCnCProxy.exe Command-and-control channel to the Defender cloud
Auto investigation SenseIR.exe Runs AIR on the endpoint — collects and remediates
Network detection SenseNdr.exe Network detection & response sensor
Config management SenseCM Applies security settings when MDE (not Intune) manages the device
Next-gen AV engine MsMpEng.exe (service WinDefend) Real-time antivirus, cloud lookups, ASR enforcement
Network inspection NisSrv.exe Network Inspection Service for exploit/network signatures

Two consequences follow. First, because the sensor is the OS, “upgrading the agent” mostly means keeping the platform and security-intelligence updates current (MpCmdRun.exe -SignatureUpdate, or just Windows Update); a device on stale platform bits reports as “sensor unhealthy” in the inventory. Second, connectivity is a first-class requirement: the sensor must reach the Defender cloud service URLs. Newer tenants can use streamlined connectivity (a small consolidated URL set) instead of the older, longer allow-list — run the client analyzer (MDEClientAnalyzer) when a device onboards but never turns “Active”, because the usual cause is a proxy or firewall eating the cloud traffic.

Onboarding mechanisms, in depth

The three-row table earlier is the summary; here’s the full menu and when each is right:

On the licensing edges: MDE for Servers capabilities are delivered per-server through Defender for Servers Plan 2 (part of Defender for Cloud), which includes MDE Plan 2 features on that server. Defender for Business is the SMB variant bundled in Microsoft 365 Business Premium (simplified, up to 300 seats). Premium vulnerability-management features (authenticated scans, browser-extension and certificate assessment, hardware/firmware inventory) come from the Defender Vulnerability Management add-on, not base P2.

Cloud-delivered protection and block-at-first-sight

“Cloud-delivered protection” (historically MAPS, the Microsoft Active Protection Service) is why the next-gen AV catches things a local signature never saw. The mechanism worth understanding is block at first sight (BAFS): when the client meets a new or rarely-seen file, it doesn’t just scan it locally — it computes a hash, sends metadata (and, if consent allows, the sample) to the cloud, and holds the file from executing until the cloud returns a verdict or the timeout expires. That’s exactly why the two settings from step 3 matter:

BAFS needs cloud protection and sample submission set to at least “safe samples” and real-time protection on. Disable any one and block-at-first-sight quietly stops working while the toggle still looks green.

How ASR policies merge (and why exclusions bite)

In a real estate, a device often receives ASR settings from more than one place. The rules to keep in your head:

Exploit protection — the EMET successor

Beyond ASR, exploit protection applies memory-safety mitigations system-wide and per-app: DEP, ASLR (including mandatory/bottom-up), Control Flow Guard (CFG), SEHOP, validate heap integrity, and Arbitrary Code Guard among them. It replaces the retired EMET. You build a baseline on a reference machine, export it, and push the XML via an Intune Exploit protection profile:

# Inspect current mitigations, then export a baseline to XML
Get-ProcessMitigation -System
Get-ProcessMitigation -RegistryConfigFilePath 'C:\eng\exploit-baseline.xml'  # export

# Apply a per-process mitigation locally (Intune XML is the fleet source of truth)
Set-ProcessMitigation -Name "lob-app.exe" -Enable DEP,ForceRelocateImages

Per-app mitigations break older software far more readily than ASR, so treat exploit protection as its own audit-first project — test each app mitigation before enforcing.

Inside Automated Investigation & Response

When an alert that supports automation fires, SenseIR opens an automated investigation: it walks the alert’s entities (files, processes, services, scheduled tasks, registry keys, drivers), expands to related artifacts, and assigns each a verdict — Malicious, Suspicious, or No threats found. For malicious verdicts it proposes remediation actions (quarantine file, stop and quarantine process, remove a scheduled-task/registry/service persistence).

What happens to those actions depends on the group’s automation level:

Automation level Behaviour
Full - remediate threats automatically Malicious verdicts are actioned immediately, no human
Semi - require approval for any remediation Every action waits in the Action center for approval
Semi - require approval for core folders Auto-remediate elsewhere; approve actions in OS/core folders
Semi - require approval for non-temp folders Auto-remediate temp folders; approve the rest
No automated response AIR investigates but takes no action

Pending and completed actions live in Action center, and remediations are reversible there (release from quarantine, undo) — which is exactly why starting at a Semi level while you learn a group’s software is low-risk: you see AIR’s reasoning and can approve or reject before anything moves. Newly created device groups default to Full; sensitive server and executive groups are the ones to hold at Semi deliberately.

Advanced Hunting — the schema underneath the queries

Advanced hunting is KQL over a fixed set of Device* tables (raw telemetry retained 30 days; alerts/incidents in the portal for 180 days). The ones you’ll live in:

Table Holds
DeviceProcessEvents Process creations + command lines, signer, parent process
DeviceNetworkEvents Outbound/inbound connections, remote IP/URL, initiating process
DeviceFileEvents File create / modify / rename / delete
DeviceRegistryEvents Registry key/value changes
DeviceImageLoadEvents DLL / image loads (DLL side-loading, injected modules)
DeviceLogonEvents Interactive / network / remote logons on the device
DeviceEvents Misc security events — ASR, AMSI, tamper, WDAC, exploit-guard
DeviceInfo / DeviceNetworkInfo Device metadata, OS, Entra join state, IPs
DeviceTvmSoftwareInventory / DeviceTvmSoftwareVulnerabilities Installed software and matched CVEs
AlertInfo / AlertEvidence Alerts and the entities behind them

The power comes from joining them. This query links a suspicious outbound connection back to the process that opened it and the alert that flagged it — a mini investigation in one statement:

// Processes that made a connection to a rare external IP in the last day
DeviceNetworkEvents
| where Timestamp > ago(1d)
| where RemoteIPType == "Public" and ActionType == "ConnectionSuccess"
| summarize Conns = count(), Devices = dcount(DeviceId) by RemoteIP, InitiatingProcessFileName
| where Devices <= 3          // rare across the fleet = more interesting
| order by Conns asc
// LSASS credential-dumping shape, joined to any alert on the same device
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "rundll32.exe" and ProcessCommandLine has "comsvcs.dll" and ProcessCommandLine has "MiniDump"
| join kind=leftouter (
    AlertEvidence | where Timestamp > ago(7d) | project DeviceId, AlertId, Title=EntityType
  ) on DeviceId
| project Timestamp, DeviceName, InitiatingProcessFileName, ProcessCommandLine, AlertId

Any hunting query becomes a custom detection rule (Plan 2) via Advanced hunting -> Create detection rule: it runs on a schedule, raises an alert, and can trigger a response (isolate device, collect investigation package, run AV scan). The companion lesson Defender XDR: advanced hunting, custom detections, attack disruption goes far deeper on building a detection library.

Device isolation and live response

When a device is compromised, two response actions matter most:

Live response is the remote shell. Beyond the commands in step 8, the session supports connections, registry, scheduledtasks, services, fileinfo, findfile, and a library you can upload PowerShell scripts to and run on the endpoint. Running unsigned scripts requires a separate toggle in Advanced features; every keystroke and file transfer is recorded to the device’s Action center. Live response for servers is a distinct switch — enable it deliberately and scope who holds the live response and live response advanced RBAC permissions.

TVM: from “you have a CVE” to a deployed fix

Threat & Vulnerability Management scores your estate two ways that point in opposite directions: the exposure score (0–100, lower is better — how much attackable surface you carry) and Microsoft Secure Score for Devices (a percentage, higher is better — how much recommended hardening you’ve applied). The workflow that makes TVM more than a dashboard is the Request remediation button on a recommendation: it creates a security task in Intune assigned to the endpoint team, so the CVE and its fix travel together instead of dying in a spreadsheet. Premium Defender Vulnerability Management adds authenticated network scans, block-listing of vulnerable app versions, and browser-extension/certificate/firmware assessment.

Defender XDR, Unified RBAC, and Sentinel

MDE alerts don’t live alone. The Microsoft Defender portal (security.microsoft.com) is the unified XDR surface that correlates endpoint alerts with Defender for Identity, Defender for Office 365, Defender for Cloud Apps, and Defender for Cloud into a single incident — often with automatic attack disruption that isolates a device or suspends an account mid-attack.

Two governance points production teams hit:

That “stream it out” is the Microsoft Sentinel integration: the Defender XDR data connector pushes incidents, alerts, and the raw Device* tables into a Sentinel Log Analytics workspace with bi-directional incident sync. Microsoft’s unified security operations platform goes further and onboards Sentinel into the Defender portal, giving one incident queue and letting a hunt span endpoint, identity, and long-retention Sentinel data together. Wiring is covered in Microsoft Sentinel: deployment, analytics, SOAR.

Verify

Validate the rollout end to end before declaring it done:

  1. Onboarding — device shows Active in the Defender portal inventory; OnboardingState = 1 on the host.
  2. EICAR (antivirus) — drop the harmless EICAR test string into a file and save. Defender should quarantine it instantly and raise an alert.
    # This WILL be detected/quarantined — that's the point
    'X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*' |
      Out-File -FilePath "$env:TEMP\eicar.com" -Encoding ascii
    
  3. WICAR (web protection) — browse to a WICAR test page from a device with Network protection in block mode; the connection should be blocked and logged under web protection.
  4. ASR — trigger an audited rule (e.g., have Word launch cmd.exe on a pilot box) and confirm the Asr...Audited/Blocked event in advanced hunting.
  5. Device timeline — open the device in the portal, go to the Timeline tab, and confirm the test events (EICAR, ASR, web block) appear in chronological order with full process context.
  6. AIR — confirm an automated investigation kicked off for the EICAR alert under Investigations.

Rollout checklist

Practice challenges

Work these in order — they climb from “confirm the basics” to “design the rollout”. Each solution notes the why, not just the what. Treat every command as representative: this host has no onboarded device, so the point is to know the exact call and expected result, not to run it here.

<details> <summary><strong>1. (Beginner) Prove a single device is actually onboarded.</strong> Which two independent checks confirm it, and what values do you want?</summary>

Run both on the host, elevated:

Get-MpComputerStatus | Select-Object AMRunningMode, AMServiceEnabled, RealTimeProtectionEnabled
Get-ItemPropertyValue 'HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status' -Name OnboardingState

You want OnboardingState = 1 and AMRunningMode = Normal or EDR Block Mode, plus the device showing Active in the Defender portal inventory.

Why: the registry flag proves the sensor was switched on; AMRunningMode proves the AV engine’s role (Normal vs Passive changes what enforces). One check without the other misleads you. </details>

<details> <summary><strong>2. (Beginner) Confirm cloud-delivered protection and tamper protection.</strong> Which is safe to read locally, and which must you verify in the portal?</summary>

Cloud protection is locally visible:

Get-MpPreference | Select-Object MAPSReporting, SubmitSamplesConsent, CloudBlockLevel, CloudExtendedTimeout

Want MAPSReporting = Advanced (2), a non-Never submission consent, and a raised CloudExtendedTimeout. Tamper protection you confirm in the Defender portal / Intune, not by trusting a local value — the whole point of tamper protection is that local state can’t be relied on.

Why: cloud protection is the detection brain; tamper protection is the lock on the brain. A green local reading for tamper protection can itself be tampered with, so the portal is the source of truth. </details>

<details> <summary><strong>3. (Intermediate) Put the LSASS ASR rule into Audit on a pilot box via PowerShell, then read back its state.</strong></summary>

# 2 = Audit (does NOT block; only logs what it would have blocked)
Add-MpPreference -AttackSurfaceReductionRules_Ids 9e6c4e1f-7d60-472f-ba1a-a39ef669e4b2 `
                -AttackSurfaceReductionRules_Actions AuditMode

Get-MpPreference | Select-Object -ExpandProperty AttackSurfaceReductionRules_Ids
Get-MpPreference | Select-Object -ExpandProperty AttackSurfaceReductionRules_Actions

The two arrays line up by index — GUID i maps to action i. AuditMode here (not Enabled, which means Block).

Why: audit-first is the cardinal ASR rule. Setting Enabled (Block) straight away is exactly the mistake that buries a service desk — you log first, review, exclude, then enforce. </details>

<details> <summary><strong>4. (Intermediate) Write a hunting query that lists what the “Office child process” ASR rule would have blocked in the last 14 days, by folder and initiating process.</strong></summary>

DeviceEvents
| where Timestamp > ago(14d)
| where ActionType == "AsrOfficeChildProcessAudited"
| summarize Hits = count(), Devices = dcount(DeviceId), Last = max(Timestamp)
    by FolderPath, InitiatingProcessFileName
| order by Hits desc

Why: you review by rule + path + initiating process, not by raw aggregate count. Low-frequency, high-importance offenders (a month-end macro) hide in the tail — summarizing by folder and process surfaces them so you can exclude precisely instead of disabling the whole rule. </details>

<details> <summary><strong>5. (Advanced) Turn a credential-theft hunting query into a custom detection rule that isolates the device. What are the required pieces?</strong></summary>

Start from a precise query that projects the entities the rule needs (at least DeviceId, and ideally ReportId/Timestamp so evidence maps cleanly):

DeviceProcessEvents
| where Timestamp > ago(1h)
| where FileName =~ "rundll32.exe"
      and ProcessCommandLine has "comsvcs.dll" and ProcessCommandLine has "MiniDump"
| project Timestamp, DeviceId, DeviceName, ReportId, InitiatingProcessFileName, ProcessCommandLine

Then Advanced hunting -> Create detection rule and set: frequency (e.g., every hour), severity, impacted entities (map DeviceId/DeviceName), and an automated response action = Isolate device (Full or Selective) and/or Collect investigation package. Requires Plan 2.

Why: a detection rule is only as good as its entity mapping — without a mapped DeviceId the automated isolation has nothing to act on. And the query must be tight, because this one auto-isolates machines; a sloppy where clause becomes a self-inflicted outage. </details>

<details> <summary><strong>6. (Advanced) Design the AIR automation-level progression across pilot, server, and broad-client rings, and justify each choice.</strong></summary>

A defensible design:

Why: automation level is a per-device-group trade of speed against blast radius. Full where mistakes are cheap and speed matters (user laptops); Semi where mistakes are expensive (servers, executives). Remember remediations are reversible from the Action center, which is what makes graduating to Full safe. </details>

Common beginner mistakes

These are conceptual traps — the wrong mental model — distinct from the operational pitfalls listed below.

Pitfalls and next steps

Once the baseline is stable, wire MDE alerts and the device timeline into Microsoft Sentinel, then expand the ring rollout from pilot to broad. From there, graduate AIR to full automation on well-understood client groups and let TVM drive your patch priorities — that’s when MDE stops being an agent on a box and starts being an operating model.

Glossary

Defender for EndpointEDRASRIntuneEndpoint SecurityMDE
Need this built for real?

Vinod is a Senior Cloud Architect (22+ yrs) — available for Azure / AWS / GCP architecture, landing zones, and migrations.

Work with me

Comments