In this section

Microsoft Defender Antivirus: Detection, Remediation, Scans and Health in Defender for Endpoint

Module 0

Introduction

Every estate has antivirus, and almost every estate reports it as healthy. The question this lesson asks is narrower and harder: when the engine found something, did it stop it? And on the devices where it found nothing, was it running at all? Both questions have answers in the sensor's records, and on this estate the answers are uncomfortable.

Antivirus is the oldest endpoint control and the one most often treated as finished. It is switched on by default, its console shows a shield and a status, and an audit asks whether it is enabled.

None of those things say what the engine does when it finds a threat, or whether it is still looking. Those are configuration and health questions, and both are answered in records rather than in the console's summary.

The previous lessons met one of the estate's antivirus detections in passing: the downloaded script in lesson 0.1's intrusion, detected and not remediated. This lesson reads every detection on the estate in March, the month of scans around them, and the one device whose antivirus stopped doing its work without anything turning red.

1. Detectedthe engine identified the file as a threat2. Runningit was already executing when identified3. Remediatedthe engine stopped, removed or quarantined it4. Not remediatedidentified and left: a record, not a protection

The three fields that decide what an antivirus detection means.

The figure is the reading every detection gets in this lesson. A detection is a statement that the engine identified something; whether anything was protected depends on the two fields after it.

01

Three Detections, Read for Outcome

What the engine did after it identified something

Defender records each antivirus verdict as an AntivirusDetection event, with the threat name and two fields that say what happened next: whether the file was running when it was identified, and whether the engine remediated it. The estate's March detections:

DeviceEvents
| where ActionType == 'AntivirusDetection'
| extend F = parse_json(AdditionalFields)
| project Day = format_datetime(Timestamp, 'MM-dd HH:mm:ss'), DeviceName, FileName,
    Remediated = tostring(F.WasRemediated),
    Running = tostring(F.WasExecutingWhileDetected)
| order by Day asc

The query returns three detections on three devices, oldest first:

Day             DeviceName      FileName       Remediated  Running
--------------  --------------  -------------  ----------  -------
03-10 10:35:00  NE-THOMPSON-LT  u.ps1          false       true
03-12 11:02:20  NE-BENNETT-LT   notlocker.exe  false       true
03-14 16:02:47  WEB-NGE-MCR-01  kdevtmpfsi     true        true

Three detections, on two laptops and the Linux web server. Every one has Running true: the file was already executing when the engine identified it. Only one has Remediated true, the coin miner on WEB-NGE-MCR-01. The other two, the downloaded script on NE-THOMPSON-LT and the ransomware on NE-BENNETT-LT, were identified correctly and left running.

Three detections, three outcomes

Detected is not stopped

NE-THOMPSON-LT, 10 March

u.ps1, the downloaded script: running, not remediated

NE-BENNETT-LT, 12 March

notlocker.exe, ransomware: running, not remediated

WEB-NGE-MCR-01, 14 March

kdevtmpfsi, a coin miner: running, remediated

In common

every one was found while running, none before

That pattern is the subject of Module 5's first lesson, configured and doing nothing. The engine's signatures were good enough to name every threat correctly, so the problem is not detection quality. It is what the configuration tells the engine to do with a verdict, and how early the verdict arrives.

An engine that names ransomware six seconds after it starts and then lets it run is configured to report rather than to protect, whatever the console calls it.

Notice also what the records do not say. A detection carries no field for the policy that applied, so the reason the two laptops left their threats running is not in the event. It is in the configuration those devices received, which Module 5 reads alongside the records. The event tells you the outcome; the policy tells you why.

The threat names are worth reading too, because they say what kind of thing each file was: a script downloader, a ransomware family and a coin miner. Defender lets the action taken on a threat depend on how severe it is judged to be, so the same estate can quarantine one category and only report another.

A ransomware verdict left running is a clear sign that whatever action applied to it on that laptop was not one that removes or quarantines, and the downloader on the other laptop shows the same.

The fix is not one setting, which is why Module 5 has eleven lessons. Real-time protection, cloud protection and its timeout, block at first sight, the remediation action for each threat category and potentially unwanted application handling all play a part, and each has a default that is not the strongest choice.

02

Six Seconds

Ransomware, identified and left running

The detection on NE-BENNETT-LT is the most serious record in the estate's antivirus data. Lining it up with the process event for the same file shows how it went:

union
    (DeviceProcessEvents
    | where DeviceName == 'NE-BENNETT-LT' and FileName =~ 'notlocker.exe'
    | project Timestamp, Record = 'process started',
        Detail = InitiatingProcessFileName),
    (DeviceEvents
    | where DeviceName == 'NE-BENNETT-LT' and ActionType == 'AntivirusDetection'
    | project Timestamp, Record = 'antivirus detection',
        Detail = FileName)
| project Time = format_datetime(Timestamp, 'HH:mm:ss'), Record, Detail
| order by Time asc

The process start and the detection, in time order, read:

Time      Record               Detail
--------  -------------------  --------------
11:02:14  process started      powershell.exe
11:02:20  antivirus detection  notlocker.exe

PowerShell started notlocker.exe at 11:02:14, with a command line telling it to work through C:\Users. Six seconds later the engine identified it as Ransom:Win32/NotLocker.A. The detection record says it was running, and that it was not remediated.

Six seconds is fast for a detection and slow for ransomware. A tool built to encrypt a user's files works through them as quickly as the disk allows, so every second between start and remediation is files lost.

The engine's verdict arrived in time to matter, and the configuration did nothing with it. Module 5 covers the settings that would have changed this: cloud protection that blocks a file the first time it is seen rather than after it runs, and remediation that acts on a verdict immediately.

Compare the downloaded script on NE-THOMPSON-LT. PowerShell fetched and ran it at 10:31, and the detection came at 10:35, about four minutes later. The ransomware's six seconds looks fast beside that, but both have the same shape: the file ran first and was named afterwards, and in both cases the name was all that happened.

There is a second point in the parent process. notlocker.exe was started by PowerShell, which means something earlier on the laptop had a PowerShell session able to start an executable from the user's Temp folder.

That is the same shape as lesson 0.1's intrusion, and the same ASR rules from lesson 0.4 would have had a chance to refuse the step before the antivirus engine ever saw the file. Layers exist so that one failing is not the end; on this laptop, two of them were set to watch.

The folder matters as well. The file ran from the user's own Temp directory, a place any process the user runs can write to, which is why so many controls in this course treat user-writable locations as the ones to watch first.

An executable that appears in Temp and starts within seconds, launched by a scripting host, is a pattern that application control and attack surface reduction can both act on before an antivirus verdict exists. Lesson 0.6 introduces the first of those.

03

The One That Was Stopped

A coin miner on the Linux web server

The only remediated detection is the one on WEB-NGE-MCR-01, the internet-facing Linux server: kdevtmpfsi in /tmp/.ICE-unix, identified as Trojan:Linux/CoinMiner, started by the node process that runs the web application, and remediated.

That record says three useful things. First, the Linux engine was configured to act, which the two Windows laptops' engines were not, so configuration across the estate is inconsistent by platform. Second, the file was started by the web application's own process, which means something reached the server through the application, and remediating the miner removes the symptom without closing the way in.

Third, the miner hid in a temporary directory with a name chosen to look like part of the desktop environment, a choice aimed at a person reading a directory listing rather than at an engine.

A remediated detection is the start of work, not the end. The engine removed one file; it did not explain how the file arrived or whether the same route was used for anything else.

Module 8 covers server and Linux protection in depth, and the question of what a web application should be allowed to start is an application control question that Module 6 introduces. Lesson 0.8 returns to this server.

The route is in the server's network records. Every connection from WEB-NGE-MCR-01 to the address the miner's parent was talking to:

DeviceNetworkEvents
| where DeviceName == 'WEB-NGE-MCR-01' and RemoteIP == '45.137.21.88'
| summarize Connections = count(),
    FirstSeen = min(Timestamp), LastSeen = max(Timestamp)
    by Process = InitiatingProcessFileName, RemotePort
| project Process, RemotePort, Connections,
    FirstSeen = format_datetime(FirstSeen, 'MM-dd HH:mm'),
    LastSeen = format_datetime(LastSeen, 'MM-dd HH:mm')

Grouped by the process that made them, the connections read:

Process  RemotePort  Connections  FirstSeen    LastSeen
-------  ----------  -----------  -----------  -----------
node     8443        34           03-12 14:07  03-14 15:45
curl     8443        1            03-12 15:30  03-12 15:30

The node process connected to 45.137.21.88 on port 8443 34 times between 03-12 14:07 and 03-14 15:45, and curl made one connection to the same port on 03-12.

That is two days of the web application's process talking to an outside address on a non-standard port, ending seventeen minutes before the miner was detected. The antivirus engine removed the miner and said nothing about the connections, because connections are not files and an antivirus verdict is about files.

For this lesson, the record's value is as a contrast.

The same product, on a different platform with a different configuration, did what the Windows laptops did not, which proves the difference is the configuration and not the engine. It is also a warning about what a remediated detection hides: on this server the one success in the antivirus data sits on top of a foothold that the antivirus data does not show at all.

04

A Month of Scans That Found Nothing

Why a clean scan is not the protection

Scheduled scans are the most visible part of antivirus, and the easiest to report on. Every scan the estate completed in the period, grouped by type and by what it found:

DeviceEvents
| where ActionType == 'AntivirusScanCompleted'
| extend F = parse_json(AdditionalFields)
| summarize Scans = count(), Devices = dcount(DeviceName)
    by ScanType = tostring(F.ScanType), Threats = tostring(F.ThreatsDetected)

Grouped that way, every scan falls into a single line:

ScanType  Threats  Scans  Devices
--------  -------  -----  -------
Quick     0        427    20

427 quick scans on 20 devices, and every one found nothing. Over the same weeks the engine identified a downloader, a ransomware binary and a coin miner. None of those came from a scan; all three were found by real-time protection as the files ran, which is the only place they could have been found, because each started within seconds of arriving.

That is the case Module 5 makes in its lesson on schedules: a scheduled scan is a request to look at what is on disk at a time of day, and modern threats are rarely sitting on disk waiting for it.

Scans still have a job, finding what arrived while protection was off and confirming a device is clean after an incident, but a report built on scan results measures the part of antivirus that matters least.

Where a scan does earn its place on this estate is after the detections. NE-BENNETT-LT ran an unremediated ransomware binary, and a full scan of that laptop is part of confirming nothing else arrived with it. That scan is a decision taken because of a detection, not a schedule, and its result means something because of the question it was run to answer.

Every scan in the period was a quick scan, which looks at the places malware usually starts from rather than every file on the disk. That is a reasonable daily choice, and Module 5 discusses when a full scan earns its cost. It does not change the point: neither kind of scan was ever going to see a file that ran and was caught within seconds of arriving.

The honest antivirus report is built from the detections and their outcomes, from real-time protection's state on each device, and from the devices that stopped reporting either. A dashboard of green scan results on this estate would have shown 427 successes in the month a ransomware binary was left running.

05

Enabled Is Not Healthy

A Mac that stopped scanning

The scans are still useful for one thing: as a heartbeat. A device that scans on a schedule and stops is a device whose antivirus has changed state, whether or not anything else says so. The devices that have gone longest without a completed scan:

DeviceEvents
| where ActionType == 'AntivirusScanCompleted'
| summarize LastScan = max(Timestamp) by DeviceName
| extend DaysSince = datetime_diff('day', datetime(2026-03-15 12:00), LastScan)
| top 4 by DaysSince desc
| project DeviceName, DaysSince,
    LastScan = format_datetime(LastScan, 'yyyy-MM-dd HH:mm')

The four devices that have gone longest without a scan, the longest first:

DeviceName        DaysSince  LastScan
----------------  ---------  ----------------
NE-WEBB-MBP       6          2026-03-09 16:55
NE-SHARMA-LT      2          2026-03-13 23:55
NE-KHAN-LT        2          2026-03-13 21:32
NE-RICHARDSON-LT  2          2026-03-13 19:02

NE-WEBB-MBP, the Mac, last completed a scan on 2026-03-09, 6 days before the estate's records end. Every other device scanned within the last two days. Yet lesson 0.2's inventory shows the Mac's sensor as Active: the device is reporting to the service, and its endpoint detection is healthy by every measure the inventory uses.

That is the gap Module 5's lesson on health is named for. Sensor health and antivirus health are different things, reported in different places, and a device can be healthy in one and broken in the other.

On a Mac the antivirus is part of the Defender application, which needs its own permissions on the operating system to scan files, and a permission revoked by an update or a user leaves the sensor reporting while the scanning stops. The records cannot say which happened here; they say that something did, six days ago, and nothing alerted.

The check is cheap. Last scan per device, sorted oldest first, is one query, and any device more than a few days behind the rest is a device to look at today. It is the antivirus counterpart of lesson 0.2's coverage check, and it belongs in the same weekly report.

The query has one weakness worth knowing. A device that has never completed a scan does not appear in it at all, because there is no record to take a maximum of. Joining the scan records to the device inventory, so that every onboarded device appears with its last scan or with nothing, closes that gap, and Module 5's health lesson builds the joined version.

For the Mac itself, the next step is to look at what else the device has reported since 03-09: whether the antivirus reported anything at all, and whether its configuration changed. The records narrow the question to one device and one date, which is most of the work.

06

What Module 5 Builds On It

Antivirus engineering and behavioral protection

Module 5 starts where this lesson's first section did: antivirus that is configured and doing nothing. It treats the cloud as the network dependency it is, reads which engine caught a threat, and finds the rules that detect without telling anyone.

It covers protection for everything that is not Edge, scheduled scans as requests rather than guarantees, the exclusion list as a target, potentially unwanted applications, and the difference between enabled and healthy that the Mac shows.

What Module 5 builds

Module 5

5.1 to 5.3

configured and doing nothing, the cloud as a dependency, which engine caught it

5.4 to 5.6

the rule that tells nobody, the layer for everything not Edge, a schedule as a request

5.7 to 5.9

the exclusion list as a target, potentially unwanted applications, enabled is not healthy

5.10 to 5.11

servers are not large workstations, and one afternoon, six controls

It ends with servers, which are not large workstations and need their own antivirus settings, and an afternoon in which six controls are changed on one estate and the records show the effect of each.

That is this lesson's evidence turned into a plan. Each finding here has a lesson there: the unremediated detections have the first, the six seconds have the cloud and engine lessons, and the Mac has the health lesson.

Module 5 works on this same estate. When it changes a setting, the change is checked in the records the way this lesson read them: a detection that now shows Remediated true, a gap between process start and verdict that shrinks, a device whose last scan stops falling behind.

A setting that changes nothing in the records has not been shown to work, whatever the console reports after it is saved. That standard, configuration judged by its evidence, is the one the module holds every control to, and it is the reason this lesson spent its time on records rather than on settings pages.

The habits to carry into it are the ones this lesson used, and none of them needs anything beyond the records already waiting in the Endpoint Range. Read every detection for Remediated and Running, never the threat name alone.

Line a detection up with the process start to see how long the threat ran. Treat a remediated detection as the start of the investigation into how the file arrived. Do not report scan results as protection. And watch the last scan per device as a heartbeat that sensor health does not replace.

Do

Practice

Decide which detections protected anything
prepared evidence

The prepared evidence below is the estate's three antivirus detections, with the threat name and the two outcome fields. Decide which stopped the threat, which was the most dangerous to leave, and what the shared Running value says about where protection is acting. Each answer comes with its reasoning, so check it against the rows rather than only the choice.

Read across each row before deciding: the threat name says what the file was, Running says when the engine reached its verdict, and Remediated says what it did with it. A row is a protection only when the last of those is true, and even then it is the start of a question about how the file arrived.

Then run the six-seconds query on this page for NE-THOMPSON-LT instead, matching the process on ProcessCommandLine has 'u.ps1' rather than on FileName, because the script ran inside PowerShell. Measure the gap between the download starting and the detection, and compare it with six seconds.

Finally, rerun the last-scan query without the top 4 and with a filter for DaysSince greater than 2. On this estate it should return the Mac alone. Note what it cannot return: a device that never scanned, which is the gap the joined version in Module 5 closes.

Keep the three queries from this lesson together: detections with their outcome fields, a detection lined up with its process start, and last scan per device. Between them they answer whether the antivirus acted, how quickly, and whether it is still running, which is more than the console's status page does.

An antivirus detection is a statement that the engine identified something. Whether anything was protected depends on whether it was remediated and whether it was caught before it ran, and on this estate two of three threats were identified and left running. Scheduled scans found nothing in a month of real threats, and a device can stop scanning while its sensor stays Active.

The next lesson adds the controls that act on devices, applications and network destinations, and asks the same question of each: recorded, or prevented.