Why the Defender switch is turned off
If Windows Security shows real-time protection off, Microsoft Defender Antivirus is not scanning files as you open, save, or download them. The toggle may also be locked, or a banner may say the setting is managed by your organization.
Table of Contents
On Windows 11, real-time monitoring is handled by the Microsoft Defender Antivirus service (often listed as WinDefend) and the Antimalware Service Executable. Windows Security is only the front-end. If another product, a policy, or a damaged service holds the platform in a passive or disabled state, that switch will not stay on.
These are the usual causes:
- A third-party antivirus is installed. Defender then switches to a passive mode so two real-time scanners are not fighting each other, and the built-in switch can look disabled.
- A policy or registry setting turned it off. Group Policy, a mobile-device management profile, a work or school account, or an old tweak can leave the option greyed out.
- Tamper protection is blocking the change. This is by design, so malware cannot silently disable Defender.
- You turned it off yourself. On a home PC, Windows typically turns real-time protection back on after a short delay. If it stays off, something else is holding the setting.
The steps below are meant to turn protection back on, not to leave your PC unprotected. Start at the top and stop when the switch works again.
Before you start
A few quick checks will tell you which fix to use and keep you from changing the wrong policy on a PC you do not fully control.
- Press Windows key, type Windows Security, and press Enter.
- Open Virus & threat protection.
- Under Virus & threat protection settings, select Manage settings.
- Look at Real-time protection. Note whether the switch is on, off, or greyed out, and whether a managed by your administrator message appears.
- On the same Virus & threat protection page, open Who’s protecting me or Manage providers and see whether another security product is listed as the active antivirus.
Microsoft describes this screen in Microsoft Defender Antivirus in the Windows Security app. If Settings itself will not open, use our guide to Settings not opening on Windows 11 first.
If you will use Group Policy, the Registry, or an administrator PowerShell command, create a restore point first. Open Start, type Create a restore point, select the system drive, choose Create, and wait until Windows confirms it. That gives you a way back if a policy change does not behave as expected.
If this PC was issued by work or school, stop after these checks and ask IT before you remove accounts or delete policy values.

Use the checklist above as you work. After each fix, reopen Windows Security and test the Real-time protection switch before you move on.
Fixes when real-time protection off appears in Windows 11
1. Check for a third-party antivirus
Another security product is the most common reason the built-in switch will not stay on. Windows Security Center lets only one real-time antivirus be active. When a third-party antivirus registers itself, Defender moves into a limited, passive mode and the Windows switch can appear disabled or flip back off.
- In Windows Security, open Virus & threat protection and look under Who’s protecting me or Manage providers.
- Open Settings > Apps > Installed apps and look for another antivirus, internet security suite, or “endpoint” product. Include leftover tools from a trial you thought you removed.
- If you find one you no longer want, select it, choose Uninstall, and follow its removal wizard if one appears. Remove any leftover “cleanup” tool as well.
- Restart the PC, then open Windows Security again.
After the restart, Defender should take over, and the real-time protection off state should clear on its own. If you still need the other product, use its own settings rather than fighting the Windows switch.
2. Turn the Real-time protection switch back on
If the switch can be moved, turn it on and wait a few seconds. On a home PC with no other antivirus, this is often enough when you disabled the setting yourself.
- Go back to Virus & threat protection settings.
- Set Real-time protection to On.
- If Windows asks for administrator permission, approve it.
- Stay on the page for about 10 seconds and confirm the switch does not flip back by itself.
If the switch flips back to off on its own, continue with the tamper protection and policy checks below. Also make sure Windows Update can finish, because security components sometimes fail when an update is stuck. See our guide if Windows 11 Update is stuck at 0%.
Success is simple: the switch stays on, and you can start a quick scan from Virus & threat protection. If a “managed” banner appears, skip to Fixes 4 through 6.
3. Turn off tamper protection so you can change the setting
Tamper protection stops other apps, and sometimes older tools, from changing Defender settings. If the real-time switch will not stay on, you may need to turn off tamper protection briefly, make the change, then enable it again. Microsoft designed this lock so malware cannot silently disable scanning.
- In Virus & threat protection settings, find Tamper protection.
- Set it to Off and confirm the administrator prompt.
- Set Real-time protection to On and wait a few seconds.
- Set Tamper protection back to On.
Microsoft explains how this setting works in Configure tamper protection for Microsoft Defender Antivirus on Windows. If the tamper switch is also locked, a work policy is likely in control, so go to Fix 5 or Fix 6.
Leave tamper protection on once real-time protection is working. Keeping it off only to “make changes easier” removes a safeguard Windows Security depends on.
4. Fix real-time protection greyed out in Group Policy
On Windows 11 Pro, Enterprise, or Education, a local policy can leave the real-time switch locked. That is a frequent reason people see real-time protection greyed out after using a “debloat” script, a forum tweak, or an old company image. Home edition does not include the Group Policy Editor, so skip to Fix 5 if gpedit.msc will not open.
- Press Windows key + R, type
gpedit.msc, and press Enter. - Go to Computer Configuration > Administrative Templates > Windows Components > Microsoft Defender Antivirus > Real-time Protection.
- Open Turn off real-time protection.
- Select Not Configured, then OK. Do not choose Disabled unless you are sure you need that state for a specific policy test.
- Also check Turn off Microsoft Defender Antivirus in the parent Microsoft Defender Antivirus folder and set that to Not Configured if it was enabled.
- Close the editor and restart the PC.
After the restart, the switch should be usable again. Not Configured allows monitoring by default. Enabled on “Turn off real-time protection” locks the switch off. If it stays locked, a management profile may be reapplying the policy, so continue with Fix 6.
5. Clear a “managed by your administrator” policy in the Registry
If Windows Security says the setting is managed by your administrator, a policy value may still be in the registry, even on a personal PC. That message can linger after a removed work account or after a manual registry tweak. Back up the registry first, and only change these keys on a computer you own.
- Press Windows key + R, type
regedit, and press Enter. Approve the administrator prompt. - Choose File > Export and save a backup of the key you are about to edit.
- Go to
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender\Real-Time Protection. - If you see DisableRealtimeMonitoring, right-click it and choose Delete.
- Also check
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defenderfor DisableAntiSpyware and delete that value if it is present. - Restart the PC, then reopen Windows Security.
If those paths do not exist, no local registry policy is set, so move on. Do not add new values just to force the switch; even a value of 0 can leave Windows Security thinking a policy is in charge. If the banner returns after a reboot, continue with Fix 6.
6. Disconnect a work or school account on a personal PC
A leftover work or school account can enforce security policy on a home computer. That enrollment can keep Defender under organization control even after you stopped using the work email day to day. Only disconnect the account if this is your personal PC and it should not be managed by an organization.
- Open Settings > Accounts > Access work or school.
- Select the work or school account, then choose Disconnect. Confirm when Windows asks.
- Restart the PC and check Windows Security again.
If the PC was issued by your workplace, contact IT instead of removing the account. Removing enrollment can break email, Wi-Fi, or device compliance. If the account is gone but the banner remains, return to Fix 5.
7. Turn Microsoft Defender back on in Terminal
If the switch still fails, you can enable monitoring from an administrator terminal. This command changes the same preference the Windows Security switch uses. It will not override a Group Policy, a management profile, or tamper protection that is still blocking the change.
- Right-click Start and select Terminal (Admin) or Windows PowerShell (Admin).
- Run:
Set-MpPreference -DisableRealtimeMonitoring $false
Get-MpComputerStatus | Select-Object RealTimeProtectionEnabled, AntivirusEnabled, AMServiceEnabled
- Confirm that RealTimeProtectionEnabled is True, then reopen Windows Security.
If the terminal says True but the app still shows real-time protection off, repair Windows Security in Fix 8. If the command returns a policy, tamper, or access-denied error, go back to Fixes 3 to 6 and run the window as administrator.
8. Repair Windows Security and system files
If you still have real-time protection off after the policy checks, repair the app, then scan system files. A damaged Windows Security package or a failed update can leave the switch unresponsive even when no policy is set.
- Open Settings > Apps > Installed apps, find Windows Security (or Windows Defender), select Advanced options, and choose Repair. If that fails, choose Reset. Reset clears the app’s local data, not your personal files.
- Open Terminal (Admin) and run
DISM.exe /Online /Cleanup-image /Restorehealth. When it finishes, runsfc /scannow. - Restart the PC and test Windows Security again.
If DISM cannot download repair files, finish Windows Update first and rerun the command. If the machine is generally sluggish after protection is back on, see our how to speed up Windows 11 guide. If the app still will not stay open, use the repair install in the next section.
How to prevent it from coming back
Once the switch stays on, keep a few habits so real-time protection off does not return after the next app install or update.
Leave tamper protection enabled on a home PC. Only turn off tamper protection for the minute you need to change a blocked setting, then turn it back on. Uninstall leftover security trials completely, and restart so Defender can become the active provider again.
Avoid “debloat” scripts and random registry packs that claim to disable Defender for performance. Those often write the same policy values you just deleted, and they can leave real-time protection greyed out after the next reboot. If you use a third-party antivirus on purpose, manage scanning in that product and do not fight the Windows switch.
To confirm nothing is turning protection off in the background, open Event Viewer and go to Applications and Services Logs > Microsoft > Windows > Windows Defender > Operational. Look for events that mention protection being disabled, a policy change, or a service failing to start.
If Windows Security remains broken after Fix 8, use a repair install with an official Windows 11 ISO from Microsoft. Run setup.exe and choose to keep personal files and apps. If a startup tool seems to disable Defender, run msconfig, hide all Microsoft services, disable the rest, and restart to test. Turn those services back on when you are done.
Quick reference
| Symptom | Likely cause | Best fix to try first | Needs restart? |
|---|---|---|---|
| Another antivirus is installed, and the Defender switch will not stay on | A third-party antivirus has taken over Security Center | Uninstall it or use its own settings (Fix 1) | Yes, after uninstall |
| The switch moves but flips back off | Tamper protection or a leftover policy is reversing the click | Temporarily disable tamper protection, enable real-time, then turn tamper back on (Fix 3) | Usually no |
| The switch is greyed out on a Pro, Enterprise, or Education PC | A local Group Policy is turning monitoring off | Set Turn off real-time protection to Not Configured (Fix 4) | Yes |
| “Managed” message on a home PC | A registry policy value or leftover work account | Remove the policy registry values or the work account (Fixes 5 and 6) | Yes |
| PowerShell reports that real-time is on, but the app still looks off | Windows Security is damaged or stale | Repair the app, then run DISM and SFC (Fix 8) | Yes |
| Windows Security will not stay open | Damaged system files or a failed security update | Repair the app, then DISM, SFC, or a repair install (Fix 8) | Yes |
FAQ
Why did the real-time switch turn itself off?
A third-party antivirus taking over is the usual first reason, followed by a Group Policy or registry setting, a work or school account, or tamper protection blocking a change. Check Windows Security providers first, then the policy steps above.
Why is the real-time switch locked or grey?
A policy is controlling the setting, which is why people see real-time protection greyed out. On Pro and Enterprise, set Turn off real-time protection to Not Configured in the Group Policy Editor. On any edition, look for DisableRealtimeMonitoring in the registry and for a work or school account.
Should I leave tamper protection disabled permanently?
No. Only turn off tamper protection long enough to turn real-time monitoring back on, then enable it again. Microsoft designed tamper protection to stop unauthorized changes to Defender. Leaving it off makes it easier for unwanted software to disable scanning later.
Is it safe to ignore a “managed” message on a home PC?
Not if this is your own PC and you did not set that policy. A leftover work account or an old registry value can display that message and keep the setting managed by your administrator even after you left the organization. If the device belongs to your company, leave the policy in place and ask IT.
Does another antivirus product mean Defender is broken?
Not necessarily. Windows often puts Defender into a passive mode when another antivirus is active, so you are not running two real-time scanners at once. Uninstall the other product only if you want Defender to be the active scanner.
Why does Set-MpPreference fail with an access error?
The terminal may not be running as administrator, or tamper protection is still blocking preference changes. Approve the elevated prompt, use Fix 3, and try the command again. If a policy is in place, the command fails until you clear Group Policy, the registry value, or the work account.
Will a repair install of Windows 11 turn protection back on?
It can, when damaged Defender files are the problem rather than a policy that is still in place. Use an official Windows 11 ISO, keep your files and apps, and check Windows Security after the restart. If a work policy or a third-party antivirus is still present, address those after the repair.









