The servers you can no longer patch are the hardest ones to protect. Defender for Endpoint on Server 2012 R2 and 2016.
Source: CD's readiness notes MDE-Readiness/Day 8- GPO + unifiedmma.md (MMA on Windows 7 / 8.1 / 2008 R2, the unified solution for 2012 R2 / 2016, KB5005292, Configuration Manager 2207, SSU/LCU prerequisites, detection te
Source: CD's readiness notes
MDE-Readiness/Day 8- GPO + unifiedmma.md(MMA on Windows 7 / 8.1 / 2008 R2, the unified solution for 2012 R2 / 2016, KB5005292, Configuration Manager 2207, SSU/LCU prerequisites, detection test), rebuilt as a lab story and cross-checked against Microsoft Learn on 2026-10-28. Lab names only; screens are drawings.
On 14 October 2026 the last Extended Security Update year for Windows Server 2012 R2 ended. Contoso still has twelve of them, under a finance application nobody dares to touch, plus twenty Server 2016 machines whose extended support ends on 13 January 2027, and three Server 2008 R2 boxes behind a label printer.
Those 35 servers will get no more security patches. They are exactly the machines where endpoint detection and response is the only control left. And in the Defender portal, the twelve 2012 R2 servers show Impaired communications or are missing: they were onboarded in 2022 with the Log Analytics agent, and nobody moved them to the unified agent before the MMA path went quiet.
It happened for real: WannaCry, 2017
Old, unpatched Windows is not a theoretical risk. On 12 May 2017 one worm went through exactly those machines around the world in a single day.
What happened
| Date (2017) | Event |
|---|---|
| 14 March | Microsoft releases security update MS17-010 for a critical flaw in SMBv1, the old Windows file-sharing protocol. |
| 14 April | A group called the Shadow Brokers publishes an exploit for that flaw (EternalBlue). |
| 12 May | WannaCry ransomware starts spreading by itself over SMB, from one unpatched machine to the next. |
| 12 to 13 May | Microsoft takes the unusual step of releasing the fix for Windows XP and Server 2003, long out of support. |
| Same weekend | A security researcher finds a "kill switch" domain and registers it, which stops the spread. |
Why it worked
- Door 1, a fix that was never installed. The patch was two months old. The UK National Audit Office found that the NHS organisations hit had unpatched or unsupported Windows; most infected devices were supported Windows 7 that had simply not been patched.
- Door 2, a protocol nobody needed. SMBv1 was still switched on and reachable between machines.
- Door 3, one flat network. Once one machine was infected, nothing stopped it from reaching the next.
What it cost
| Who | What they lost |
|---|---|
| More than 200,000 computers in at least 100 countries | Files encrypted, with a bitcoin ransom note |
| The NHS in England | About 19,000 appointments cancelled; an estimated 92 million GBP (19 million lost output, 73 million IT recovery), per the Department of Health and Social Care |
| Factories, railways, telecoms | Production lines and ticket systems stopped across Europe and Asia |
The same doors in a Microsoft environment
The 35 servers in this post are the WannaCry population: old Windows, patches that stopped or were never installed. The sensor is the first step. These are the other three:
- Door 1, the patch nobody installed: once the sensor reports, Defender Vulnerability Management lists every missing update. Query 1 below finds the WannaCry flaw itself, which still shows up on forgotten machines.
-
Door 2, SMBv1: remove it. On Server 2012 R2 and 2016:
Disable-WindowsOptionalFeature -Online -FeatureName SMB1Protocol, orSet-SmbServerConfiguration -EnableSMB1Protocol $falsewhere the feature cannot be removed. - Door 3, one machine infects the next: in Defender for Endpoint, contain or isolate an infected device in one click, and turn on automatic attack disruption so it can happen without waiting. Query 2 shows which servers accept SMB connections from many internal machines, the first ones to segment.
// Query 1: devices still exposed to the WannaCry SMB flaws (MS17-010)
DeviceTvmSoftwareVulnerabilities
| where CveId in ("CVE-2017-0143", "CVE-2017-0144", "CVE-2017-0145", "CVE-2017-0146", "CVE-2017-0148")
| summarize CVEs = make_set(CveId) by DeviceName, OSPlatform, OSVersion
// Query 2: servers accepting SMB from many internal machines (last 7 days)
DeviceNetworkEvents
| where Timestamp > ago(7d)
| where ActionType == "InboundConnectionAccepted" and LocalPort == 445
| summarize Sources = dcount(RemoteIP) by DeviceName
| order by Sources desc
TL;DR
- Problem: the oldest servers carry the highest risk (unpatchable, business-critical, forgotten) and the oldest onboarding method. The 2022 way (Microsoft Monitoring Agent) is not the 2026 way (the modern unified solution for 2012 R2 / 2016, a different "Defender deployment tool" for 2008 R2 / Windows 7). Leave them on the old path and the sensor goes silent while the portal still lists the device.
- Who it hurts: the finance team whose app runs on those boxes, the SOC that has no telemetry from the most attackable servers, the CISO who signs "EDR on 100% of servers", and the budget paying Defender for Servers per machine for a sensor that does not report.
-
Fix: offboard the MMA path, meet the four prerequisites (SSU, LCU, Defender Antivirus feature on 2016, KB5005292 approved in WSUS), install the unified package with the onboarding script, verify
senseandWindefend, run the detection test; let Defender for Cloud or Configuration Manager 2207+ do it at scale. For 2008 R2 and Windows 7, the Defender deployment tool, or isolate and retire. - Cost: Defender for Servers Plan 1 about $5 per server per month (EDR), Plan 2 about $15; CrowdStrike Falcon Pro about $8.33, SentinelOne Complete about $15 per endpoint per month, both list, both support 2012 R2 / 2016 too. The 35 unpatchable servers cost more in ESU and risk than in sensors.
-
Prove it: 35 of 35 Onboarded, sensor health Active, a detection test alert from
LAB-FIN-2012-01within minutes, and vulnerability management listing the missing patches so the risk is at least visible.
Table of contents
- It happened for real: WannaCry, 2017
- 1. The problem
- 2. Who gets hurt
- 3. Cost and value
- 4. How to fix it
- 5. Prove it
- Gotchas
- Checklist
- What changed recently
- Sources
- News sources
1. The problem
An old building with no fire inspection any more. You cannot fix the wiring (no patches), so you need the smoke detectors more than in any other building. And the detectors installed in 2022 ran on a battery type nobody makes now.
Three generations of Windows Server, three onboarding paths:
| OS | Support status (Learn lifecycle, checked 2026-10-28) | Defender for Endpoint path in 2026 |
|---|---|---|
| Windows Server 2019 and later | In support | Sensor built in; onboard with a package, Intune, Configuration Manager or Defender for Cloud |
| Windows Server 2016 | Extended support ends 2027-01-13 | Modern unified solution: installer package + onboarding script; Defender Antivirus must be installed as a feature first |
| Windows Server 2012 R2 | Extended support ended 2023-10-11; ESU year 3 ended 2026-10-14 | Modern unified solution: installer brings Defender Antivirus and the EDR sensor |
| Windows Server 2008 R2 SP1, Windows 7 SP1 | Long out of support | Only with the Defender deployment tool (the old MMA path is kept only for Windows 8.1) |
The unified solution has existed since April 2022 (my notes record the date). What changed is that the alternative is gone: the MMA-based sensor for 2012 R2 / 2016 is the "previous solution", and MMA itself retired in 2024. Servers still on it look onboarded in the inventory and send nothing.
2. Who gets hurt
| Who | What they lose |
|---|---|
| Finance / the business | The app runs on the most exposed servers in the estate, with no detection |
| SOC | No process, network or logon telemetry from the machines an attacker would pick first; an incident there is found by the finance team, not by the SOC |
| CISO | "EDR on 100% of servers" in the board pack is 65% in reality |
| Budget | Defender for Servers is billed per machine in the subscription; twelve silent sensors are twelve wasted licences, on top of ESU already paid |
| The product | "Defender does not work on old servers", when the unified agent reached near parity with 2019 four years ago |
3. Cost and value
Checked 2026-10-28, USD list, per server per month unless stated; vendor list prices from their public pricing pages.
| Option | Price | Notes |
|---|---|---|
| Defender for Servers Plan 1 (via Defender for Cloud) | about $5 | EDR through the Defender for Endpoint integration; per-resource enablement possible |
| Defender for Servers Plan 2 | about $15 | Plan 1 + agentless vulnerability and malware scanning, premium vulnerability management, 500 MB/day log benefit |
| Defender for Endpoint for Servers (standalone) | quote / volume licence | Same sensor, no Defender for Cloud |
| CrowdStrike Falcon Go | $59.99 per device per year (about $5.00), max 100 devices | Entry tier |
| CrowdStrike Falcon Pro | $99.99 per device per year (about $8.33) | NGAV + basic EDR |
| CrowdStrike Falcon Enterprise | $184.99 per device per year (about $15.42) | Full EDR, threat hunting |
| SentinelOne Singularity Complete | $179.99 per endpoint per year (about $15.00) | Full EDR |
| SentinelOne Core | no public price | via partners |
All of the above support Windows Server 2012 R2 and 2016 with a current sensor; 2008 R2 is "legacy sensor" territory for every vendor, and Windows 7 is on the way out everywhere.
Lab, 35 legacy servers:
| Item | Monthly |
|---|---|
| Plan 1 on 23 web/app-tier legacy servers | $115 |
| Plan 2 on 12 finance servers (vulnerability management matters most where you cannot patch) | $180 |
| Sensors, total | $295 |
| Server 2012 R2 ESU, which just ended | no longer purchasable; the risk is now uncovered |
| Server 2016 ESU from 2027-01-13 | Microsoft sells it per core per year; Azure VMs and Azure Arc-enabled servers can enrol through Azure |
Value: $295 a month puts telemetry and vulnerability data on the 35 machines that have none and will never be patched again. The alternative control, isolation and retirement, is the right long-term answer and takes months; the sensor takes an afternoon.
4. How to fix it
Lab: LAB-FIN-2012-01..12 (Server 2012 R2), LAB-APP-2016-01..20 (Server 2016), LAB-PRN-2008-01..03 (Server 2008 R2), all Arc-enabled into sub-lab-prod, Defender for Servers Plan 1 or 2 on.
Step 1: get off the old path first. On each 2012 R2 / 2016 server still using MMA: remove the Defender for Endpoint workspace from the Microsoft Monitoring Agent (Control Panel → Microsoft Monitoring Agent → Azure Log Analytics (OMS) → remove the workspace) or uninstall MMA. Running the new installer on top of a live MMA onboarding is the classic cause of a device that is "onboarded twice and reporting never".
Step 2: prerequisites (Learn, unified solution page updated 2026-10-20).
| Requirement | 2012 R2 | 2016 |
|---|---|---|
| Servicing Stack Update from 2021-09-14 or later | required | required |
| Latest Cumulative Update from 2018-09-20 or later (latest recommended) | required | required |
| Microsoft Defender Antivirus | installed by the package | must be installed as a feature and updated before the package |
| Antimalware platform update KB4052623 | via Windows Update or the catalog | same |
| KB5005292 "Microsoft Defender for Endpoint update for EDR Sensor" approved in WSUS / Configuration Manager | required for ongoing sensor updates | same |
Step 3: download fresh, every time. Defender portal → Settings → Endpoints → Onboarding → Windows Server 2012 R2 and 2016 → download the installation package (updated monthly) and the onboarding package (Group Policy, local script, Configuration Manager or VDI flavour).
Step 4: install. Local script for the pilot:
# 1. unified solution installer
msiexec /i md4ws.msi /quiet
# 2. onboarding script from the onboarding package
.\WindowsDefenderATPOnboardingScript.cmd
# 3. verify
sc.exe query sense # STATE: RUNNING
sc.exe query Windefend # RUNNING; "does not exist" on 2016 = Defender AV feature missing
Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows Advanced Threat Protection\Status" | Select OnboardingState # 1
At scale: Configuration Manager 2207 or later deploys and onboards the unified solution automatically; Defender for Cloud does the same for Azure VMs and Arc-enabled servers once the Defender for Endpoint integration is on (the previous post covers that toggle). Group Policy with the GPO onboarding package also works, which is what my Day 8 notes used.
Step 5: connectivity. The sensor needs the Defender for Endpoint service URLs directly and without SSL inspection. The finance VLAN had TLS inspection on; the sensor installed, onboarded, and never phoned home. Allow the URL set from the proxy and connectivity doc for your geography, or use the streamlined connectivity option where the OS supports it.
Step 6: 2008 R2 and Windows 7. The MMA method is now documented only for Windows 8.1; 2008 R2 SP1 and Windows 7 SP1 onboard with the Defender deployment tool, which can also upgrade devices currently on MMA. If the label printer server cannot take it, put it on an isolated VLAN with a firewall rule to one print queue, and plan its retirement; a sensor is not a substitute for a network boundary on a 17-year-old OS.
5. Prove it
- Defender portal → Assets → Devices, filter OS = Windows Server 2012 R2 / 2016: 32 of 32 Onboarded, sensor health state Active, last seen within the hour.
- Detection test on
LAB-FIN-2012-01(the documented PowerShell test from the onboarding page): an alert in the Defender portal within minutes. - Advanced hunting:
DeviceInfo
| where Timestamp > ago(1d)
| where OSPlatform in ("WindowsServer2012R2", "WindowsServer2016")
| summarize arg_max(Timestamp, OnboardingStatus, SensorHealthState, ClientVersion) by DeviceName
| summarize count() by OnboardingStatus, SensorHealthState
Target: one row, Onboarded / Active, count 32.
- Vulnerability management → Weaknesses, filter those devices: the unpatched CVEs are listed. The risk did not go away; it is now visible, with exposure scores the CISO can decide on.
Gotchas
- "Onboarded" in the inventory means the device once onboarded. Sensor health and last-seen tell you whether it reports. Filter on Impaired communications and No sensor data.
-
Server 2016 needs Defender Antivirus as a Windows feature first.
sc query Windefendsays "does not exist" otherwise, and the EDR sensor will not run in active mode. - A DisableAntiSpyware / DisableAntiVirus policy breaks the start. Errors 577 or 1058 when starting the service: clear the policy; the ELAM driver must stay enabled.
-
Slow disks and the installer timeout.
Couldn't find ...mpasdesc.dll - 310 WinDefendon an installation: take the latest package and useinstall.ps1from Microsoft'smdefordownlevelserverrepository to clear the failed install. - Re-running the installer is not an update. It asks you to offboard first. Updates come through KB5005292; approve it in WSUS or the sensor freezes at its install version.
- OS upgrade means offboard first. For 2016 and earlier, offboard and uninstall before an in-place upgrade. Upgrading to 2019 or later is the actual fix for the whole problem.
- SSL inspection is a silent killer. Sensor installs fine, device never appears. Check the proxy before the event log.
-
Limited UI on the unified solution. Local operations via PowerShell, WMI or
MPCmdRun.exe; some attack surface reduction rules do not apply to the older OS. - Event IDs to know. SENSE operational log: 5 / 15 (cannot reach the service: connectivity), 6 (no onboarding parameters: run the script again), 55 (ETW autologger: reboot). Onboarding script: 40 (onboarding state not 1), 65 (not elevated).
Checklist
- [ ] Inventory every Server 2012 R2 / 2016 / 2008 R2 with its real sensor health, not its onboarding flag
- [ ] MMA-based onboarding removed before the unified package
- [ ] SSU + LCU current; Defender Antivirus feature installed on 2016; KB4052623 platform update
- [ ] KB5005292 approved in WSUS / Configuration Manager for ongoing sensor updates
- [ ] Fresh installer and onboarding package from the portal; Configuration Manager 2207+ or Defender for Cloud for scale
- [ ] Defender for Endpoint URLs reachable without SSL inspection from every legacy VLAN
- [ ]
senserunning,Windefendrunning, OnboardingState = 1, detection test passed - [ ] 2008 R2 / Windows 7: Defender deployment tool, or isolated and scheduled for retirement
- [ ] Plan 1 / Plan 2 decided per server; vulnerability list reviewed monthly for the unpatchable set
What changed recently
Checked against Microsoft Learn on 2026-10-28:
- My notes said "MMA will retire in August 2024" and still described the MMA route for 2012 R2 / 2016 next to the unified one. Learn now lists only the modern unified solution for those two, with the MMA route called the "previous solution" and migration guidance for leftovers (unified solution page updated 2026-10-20).
- For Windows 7 SP1 and Server 2008 R2 SP1 the documented path is now the Defender deployment tool; MMA is kept only for Windows 8.1, with a minimum agent version because of SHA-1 deprecation (down-level page updated 2026-06-03). My notes had all three on MMA.
- Lifecycle: Server 2012 R2 ESU year 3 ended 2026-10-14; Server 2016 extended support ends 2027-01-13. Both dates passed or are closer than when my notes were written, which is the point of this post.
- Prerequisite dates are explicit now: SSU from 2021-09-14, LCU from 2018-09-20, Defender Antivirus feature on 2016, KB5005292 for sensor updates, Configuration Manager 2207+ for automatic deployment.
- New known issues on the Learn page: installer timeout on slow disks (
mpasdesc.dll - 310),install.ps1for clearing failed installs, offboard before OS upgrade on 2016 and earlier. - Defender for Cloud Direct onboarding now covers non-Azure servers that were onboarded by hand, tenant-wide, with no pilot group.
Sources
- Onboard Windows Server 2012 R2 and 2016 (modern unified solution)
- Onboard previous versions of Windows
- Minimum requirements for Defender for Endpoint
- Troubleshoot onboarding issues
- Windows Server 2012 R2 lifecycle and Windows Server 2016 lifecycle
- Select a Defender for Servers plan
- CrowdStrike Falcon pricing and SentinelOne pricing (list prices as published, 2026-10-28)
- Detect, enable and disable SMBv1, SMBv2 and SMBv3
- Take response actions on a device (isolate, contain)
News sources
- UK National Audit Office, "Investigation: WannaCry cyber attack and the NHS" (October 2017): https://www.nao.org.uk/reports/investigation-wannacry-cyber-attack-and-the-nhs/
- Computer Weekly, "Cost of WannaCry attack to NHS set at 92m" (October 2018, on the Department of Health and Social Care report): https://www.computerweekly.com/news/252450600/Cost-of-WannaCry-attack-to-NHS-set-at-92m
- Microsoft Security Bulletin MS17-010 (March 2017): https://learn.microsoft.com/en-us/security-updates/securitybulletins/2017/ms17-010
Thanks for reading! I'm Cuong, and on CD Security Lab I rebuild real Microsoft security cases in a safe lab and explain them simply. Follow along:
- ▶️ YouTube (daily Shorts + explainers): CD Security Lab
- 💼 LinkedIn: Cuong Do
- 📘 Facebook: CD Security Lab
- 📸 Instagram: @cdsecuritylab
- 📝 More posts like this: Dev.to
Got a question about your own tenant? Drop it in the comments.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.



