Australian cloud for business software — built and run in Sydney since 2002

NetLeverage
NetLeverage

Defender event 5001: real-time protection is disabled

Technical article
Troubleshooting

About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.

Real-time protection is the part of Microsoft Defender Antivirus that scans files and watches activity as it happens. When it is switched off, Defender writes event ID 5001 to its Operational log. The event is a record, not a fix: it says the setting changed, and nothing in it names the person, policy or process that changed it. Finding that out is the real work.

The sections below show how to read the event, how to trace the cause across the places that can switch real-time protection off, three ways to switch it back on with a record to undo from, and how to confirm the result. Nothing before the Fix section changes anything.

What the error means

Microsoft's event page gives event 5001 the symbolic name MALWAREPROTECTION_RTP_DISABLED and the message "Real-time protection is disabled." Its description reads "Microsoft Defender Antivirus real-time protection scanning for malware and other potentially unwanted software was disabled." The page gives it no fields and no "User action" text, unlike many other Defender events. Its partner is event 5000, "Real-time protection is enabled."

Find these events in Event Viewer under Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational. Microsoft's page says you can start Event Viewer by pressing the Windows logo key + R, typing eventvwr.msc and selecting OK, and that Find and Filter are in the Actions pane.

Related events on the same page help place 5001 in a story:

Event Message on Microsoft's page
5000 "Real-time protection is enabled."
5004 "The real-time protection configuration changed."
5007 "The antimalware platform configuration changed."
5013 "Tamper protection blocked a change to Microsoft Defender Antivirus."
3002 "Real-time protection encountered an error and failed."
3007 "Real-time protection recovered from a failure. We recommend running a full system scan when you see this error."
5100 "The antimalware platform expires soon."
5101 "The antimalware platform is expired."

Likely causes

Microsoft's event page gives no causes for 5001. Microsoft's pages on always-on protection, tamper protection and troubleshooting mode name the ways real-time protection is turned off, so the list below is built from them.

Cause Where Microsoft's pages describe it
A Group Policy setting, "Turn off real-time protection", set to Enabled The always-on protection page, under disabling real-time protection in Group Policy
An endpoint security policy that does not allow real-time monitoring The same page: the Intune and Defender portal policies use "Allow Real-Time Monitoring"
A Configuration Manager antimalware policy where "Enable real-time protection" is not set to Yes The same page
PowerShell: Set-MpPreference -DisableRealtimeMonitoring $true The Set-MpPreference page describes the -DisableRealtimeMonitoring parameter
Someone slid the Real-time protection toggle to Off in the Windows Security app The same page says it turns on again automatically after a short delay
Troubleshooting mode is active on the device The troubleshooting mode page lists events 5000, 5001, 5004 and 5007 among those it can produce
The service failed, not the setting Event 3002 records a failure of the real-time protection feature
The platform's grace period ended Event 5101 says protection against viruses and spyware "is disabled" after the grace period

Microsoft gives no counts, so the order is not an order of likelihood.

Prove the cause before changing anything

All of these steps only read.

  1. Read the time of the 5001 event and look at the events either side of it in the same log. A 5004 or 5007 close to it points at a configuration change. A 5013 points at tamper protection blocking a change. A 3002 points at a failure. A 5101 points at an expired platform.

  2. Check the current state. Microsoft's tamper protection page gives this read-only command, and it shows both settings together:

Get-MpComputerStatus | Select-Object IsTamperProtected, RealTimeProtectionEnabled

Microsoft says True means the setting is enabled and False means disabled.

  1. Check the configured values. Microsoft's always-on protection page gives this read-only command:
Get-MpPreference | Select-Object DisableRealtimeMonitoring, DisableBehaviorMonitoring, RealTimeScanDirection

Microsoft says to verify that DisableRealtimeMonitoring and DisableBehaviorMonitoring are False and RealTimeScanDirection is 0. A True value in DisableRealtimeMonitoring is the setting behind event 5001.

  1. Ask where the setting comes from. In Group Policy, read Computer configuration > Administrative templates > Windows components > Microsoft Defender Antivirus > Real-time Protection, and look at "Turn off real-time protection". In Intune or the Defender portal, read the Antivirus policy that applies to the device and look at "Allow Real-Time Monitoring". In Configuration Manager, read the antimalware policy's "Enable real-time protection". Read only; close each setting without saving.

  2. Find out whether troubleshooting mode is active. Microsoft's page says it can take up to 15 minutes to start, turns itself off after four hours, and that a snapshot of MpPreference is taken before it begins. The Defender portal's Device Timeline shows when troubleshooting mode started and ended.

  3. Note one caveat. Microsoft says that on Windows Server 2016 the Windows Security app might show an inaccurate real-time protection status when tamper protection is enabled, so use the PowerShell commands above on that version.

An illustrative example, not from Microsoft: a file server shows 5001 at 02:10, a 5004 at 02:10, and Get-MpPreference reports DisableRealtimeMonitoring True. A Group Policy object linked the night before explains it. The right fix is in the policy, not on the server.

Fix

Choose the route that matches the proof. A policy that sets the value will keep setting it, so a change on one device is the wrong fix when a policy is the cause.

Microsoft says that when tamper protection is enabled, changes to tamper-protected settings are ignored, and real-time protection is one of them. Group Policy cannot turn off real-time protection while tamper protection is on, and a change that appears to succeed may be blocked, which is what event 5013 records. If a change does not stick, look for 5013 before trying again.

Route 1: correct the policy that turns it off

Before changing the policy, record its present state. For each setting named in the proof step, note whether it is Not Configured, Enabled or Disabled, and copy its options. The page gives no command for this, so it is general advice, and the record is what lets you put the policy back exactly.

Risk: the next step changes real-time protection for every device in the scope of the policy, not just the one that logged event 5001. A mistake spreads to every device under the policy. Apply the change to one test device or group first.

For Group Policy, Microsoft says to set "Turn off real-time protection" to Disabled, and to set "Configure monitoring for incoming and outgoing file and program activity" to Enabled, bi-directional (full on-access), "Turn on behavior monitoring" to Enabled and "Monitor file and program activity on your computer" to Enabled. For an Intune or Defender portal policy, Microsoft says to set Allow Real-Time Monitoring to Allowed, Allow On Access Protection to Allowed, Real Time Scan Direction to Monitor all files (bi-directional) and Allow behavior monitoring to Allowed. For Configuration Manager, set Enable real-time protection to Yes, Monitor file and program activity on your computer to Yes, Scan system files to Scan incoming and outgoing files and Enable behavior monitoring to Yes.

To undo it: putting back the recorded values can switch real-time protection off again for every device in the scope of the policy, so do it only if that was the deliberate earlier state. Open the same policy and put back the values you recorded.

Route 2: switch it on for one device with PowerShell

Before running the command, record the current values with the read-only command from the proof section (the Get-MpPreference line) and keep its output.

Risk: the next command turns on real-time monitoring and behaviour monitoring and sets scanning to cover incoming and outgoing files on this device. If tamper protection is on, Microsoft says changes to protected settings are ignored, so the command may appear to succeed without taking effect. The undo changes the same three settings back, which is only right if the earlier state was deliberate: Microsoft warns that disabling real-time protection "drastically reduces the protection on your endpoints and isn't recommended".

Microsoft says to run the command in an elevated PowerShell session (a window started by selecting Run as administrator):

Set-MpPreference -DisableRealtimeMonitoring $false -DisableBehaviorMonitoring $false -RealTimeScanDirection Both

To undo it: the next instruction can switch real-time protection off again, so use it only if the recorded values showed it was deliberately off. Run Set-MpPreference again with -DisableRealtimeMonitoring, -DisableBehaviorMonitoring and -RealTimeScanDirection set to the values the save step recorded.

Route 3: switch it on in the Windows Security app

This route is for one client device. Before using it, record the current values with the read-only Get-MpPreference line from the proof section and keep its output. Microsoft adds that if your organisation manages real-time protection, the setting might be unavailable.

Risk: the next step turns real-time protection on for this device only, and a managed policy or tamper protection can override it. The page gives no other effect. The undo of this step switches real-time protection off again.

Microsoft's steps: in the Windows Security app go to Virus & threat protection, under Virus & threat protection settings select Manage settings, and slide the Real-time protection toggle to On.

Only if you need to reverse this change: the next instruction switches real-time protection off, which Microsoft warns "drastically reduces the protection on your endpoints and isn't recommended". It is only right when the values you recorded showed real-time protection was deliberately off before. Then slide the same toggle back to Off. Microsoft says that if you turn real-time protection off, it turns on again automatically after a short delay.

Confirm the fix

  • Event 5000, "Real-time protection is enabled.", appears after the 5001, and no new 5001 follows.
  • Get-MpComputerStatus | Select-Object IsTamperProtected, RealTimeProtectionEnabled shows RealTimeProtectionEnabled as True.
  • Get-MpPreference | Select-Object DisableRealtimeMonitoring, DisableBehaviorMonitoring, RealTimeScanDirection shows False, False and 0, as Microsoft's page says to expect.
  • Event 1151, the client health report, lists "RTP state" as Enabled or Disabled.
  • No 5013 appears, which would mean tamper protection is blocking a later change.

What to watch afterwards

  • A repeat of 5001 shortly after a fix. A policy may be setting it again.
  • Events 3002 and 3007. Microsoft's page for 3002 says to restart the system and run a full scan because the system might not have been protected for some time; it says 3007 means the feature restarted.
  • Event 5013, which Microsoft says states which setting change was blocked.
  • Tampering alerts in the Defender portal. Microsoft's page says the DeviceEvents table records ActionType "TamperingAttempt" and gives an advanced hunting query that lists those events from the last ten days.
  • Troubleshooting mode being left to expire. Microsoft says the device reverts to its previous policy-managed values when it ends.

Risks and limits

These steps were researched from Microsoft's pages and have not been run or lab-tested.

Microsoft's event page does not say what causes 5001 and gives no fields for it, so the cause table is built from other Microsoft pages and is a reading, not Microsoft's list. A device can show the setting as enabled while another status reads differently, as the Windows Server 2016 note shows. Disabling real-time protection is a serious reduction in protection and Microsoft does not recommend it. If a 5001 appears and nobody on your team made the change, treat it as an open question to run down, not as noise.

Sources