Home About Tools Projects Guides & Blog ⚡ Hire Me ✦ Websites Contact →
🔍 Endpoint Security

Setting Up Endpoint Detection & Response (EDR) with Microsoft Defender

Published 19 March 2026

Antivirus stops known threats. EDR stops everything else. Where traditional antivirus works from a signature database - blocking files that match known malware - Endpoint Detection and Response monitors device behaviour continuously, looking for patterns that indicate compromise even when no known malicious file is involved. Fileless attacks, living-off-the-land techniques, lateral movement: EDR catches what AV can't.

Microsoft Defender for Endpoint Plan 2 includes a full EDR capability built into the Defender platform you likely already have. This guide covers how to configure it properly - from alert triage and automated investigation through to live response and advanced hunting.

EDR vs Antivirus: What's the Difference

🧠 Concepts

The distinction between AV and EDR matters when you're triaging alerts, so it's useful to be clear on what each one does.

CapabilityAntivirus (AV)EDR
Detection methodSignature matchingBehavioural analysis
Fileless attacksLimitedDetected
Alert contextFile blockedFull attack timeline
Forensic dataNoneProcess tree, network, registry
Response optionsQuarantineIsolate, live response, remediate
Threat huntingNot availableKQL query engine

In MDE, both capabilities run simultaneously. Windows Defender Antivirus handles real-time protection, and the EDR sensor (the MDE agent deployed via Intune) handles behavioural monitoring, telemetry collection, and the connection to the Defender Security Centre.

Alert Configuration and Severity

🔔 Alerts

MDE generates alerts across four severity levels: Informational, Low, Medium, and High. By default all are enabled - but for most SMB environments you'll want to configure notification rules so you're not drowned in noise.

Create a notification rule to email your security team (or yourself) for High and Medium severity alerts. Low and Informational can be reviewed periodically in the portal rather than generating instant email noise.

🔔
Recommended Alert Notification Rules
Configure in Settings → Endpoints → Alert notifications
High severity alertsActive ransomware, credential dumping, lateral movement indicators
Email immediately
Medium severity alertsSuspicious process behaviour, network anomalies
Email immediately
Low severity alertsPolicy violations, minor misconfigurations
Review in portal
Informational alertsAudit events, context-only signals
Not configured

Incident vs Alert

MDE groups related alerts into Incidents automatically. An incident might contain 10 alerts that are all part of the same attack chain. Always start your investigation from the Incident view rather than individual alerts - it gives you the full picture of the attack timeline and scope.

Automated Investigation and Response (AIR)

🤖 Automation

MDE's Automated Investigation and Response (AIR) engine can automatically investigate alerts and take remediation actions - quarantining files, stopping processes, removing persistence mechanisms - without requiring a human to approve each step. How much autonomy you give it depends on how much you trust the automation.

⚙️
Automation Levels
Set per device group in Permissions → Device groups
No automated responseAlerts only. No automatic actions taken.
Not recommended
Semi - require approval for all foldersMDE investigates but requires human approval for any remediation.
Good starting point
Semi - require approval for non-temp foldersAuto-remediates threats in temp/download folders, asks for approval elsewhere.
Balanced
Full - remediate threats automaticallyMDE acts on High/Medium confidence findings without human approval.
Recommended (mature orgs)
Start semi, move to full
If you're new to MDE, start with Semi - require approval for all folders for the first 4–8 weeks. Review every automated investigation in the Action Centre. Once you're confident the engine is making correct decisions, switch to Full automation so threats are dealt with immediately - even at 3am when no one's watching.

All automated actions (and any pending approvals) appear in the Action Centre:

Live Response

🖥️ Live Response

Live Response gives you a remote command-line shell into any onboarded device, directly from the Defender portal. No VPN, no RDP - just a browser tab and a PowerShell-like interface. You can collect files, run scripts, kill processes, and investigate without touching the device physically.

Enable it first:

💻
Live Response Settings
Advanced Features in Defender portal settings
Live ResponseEnables the live response shell for all onboarded devices.
Enabled
Live Response for ServersExtends live response capability to onboarded Windows servers.
Enabled
Live Response unsigned script executionAllows running unsigned PowerShell scripts. Only enable if needed - signed scripts preferred.
Disabled

To start a live response session, go to the device page in the Defender portal and click Initiate Live Response Session. Useful commands once you're in:

  • getfile <path> - download a file from the device for analysis
  • processes - list running processes
  • scheduledtasks - list scheduled tasks (common persistence mechanism)
  • registry - browse registry keys
  • run <script> - execute a script from the live response library
⚠️
Live Response gives full command-line access - use it carefully
Live Response gives you full command-line access to a production device. All actions are logged in the Action Centre, but there's no undo for destructive commands. Always confirm you're on the right device before running any scripts, and avoid running live response on user devices during working hours unless the situation demands it.

Advanced Hunting with KQL

🔎 Threat Hunting

Advanced Hunting is MDE's threat hunting query interface, powered by Kusto Query Language (KQL). It gives you 30 days of raw telemetry - process events, network connections, file operations, registry changes - that you can query freely to find threats that haven't generated alerts yet.

Useful Starter Queries

Find devices running PowerShell with encoded commands (common malware technique):

DeviceProcessEvents
| where FileName == "powershell.exe"
| where ProcessCommandLine has "-EncodedCommand"
| project Timestamp, DeviceName, ProcessCommandLine
| order by Timestamp desc

Find failed logon attempts on a specific device:

DeviceLogonEvents
| where ActionType == "LogonFailed"
| where DeviceName == "DEVICE-NAME-HERE"
| summarize FailCount=count() by AccountName, RemoteIP
| order by FailCount desc

Find processes making outbound connections on unusual ports:

DeviceNetworkEvents
| where RemotePort !in (80, 443, 53, 22, 3389)
| where InitiatingProcessFileName !in ("svchost.exe", "lsass.exe")
| project Timestamp, DeviceName, InitiatingProcessFileName, RemoteIP, RemotePort
| order by Timestamp desc
| take 100
ℹ️
Save queries as custom detections
Any Advanced Hunting query can be promoted to a Custom Detection Rule - this runs the query on a schedule (every hour, every 24 hours) and automatically generates an alert if results are returned. It's the quickest way to build custom detection logic on top of MDE without needing a SIEM.

Device Response Actions

🔒 Response

When a device is compromised or suspected to be, MDE gives you several response actions directly from the device page in the portal:

  • Isolate device - cuts the device off from the network completely (only the Defender sensor can still communicate). Use this immediately for confirmed compromises.
  • Restrict app execution - blocks all apps except those signed by Microsoft. Aggressive but effective for active attacks.
  • Run antivirus scan - triggers a full Defender AV scan on the device remotely.
  • Collect investigation package - collects a forensic bundle (event logs, running processes, network connections, prefetch files) for offline analysis.
  • Initiate automated investigation - triggers a manual AIR investigation on the device immediately.
Isolate first, investigate second
If you're looking at a confirmed active compromise, isolate the device immediately before doing anything else. This stops lateral movement and C2 communication while preserving the device for forensic investigation. The live response session remains active through isolation, so you can still investigate the device remotely after cutting it off from the network.
// monthly tips

Get M365 tips in your inbox

Practical Intune and Microsoft 365 tips, once a month. No spam, no fluff.