sodcalculator

10 Tech How-To

Fix Windows Security Unexpected Error in Windows 11

Guide 10-37156 · Updated · Step by step

If you see an “Unexpected error” message when opening Windows Security in Windows 11, the fix usually involves repairing or reinstalling the Security app, checking for corrupted system files, or resetting the app’s data. This article walks you through the most effective solutions, from quick resets to deeper system repairs, so you can get Windows Security working again.

What Causes the “Unexpected Error” in Windows Security?

Windows Security (formerly Windows Defender) is a built-in antivirus and firewall tool. The “Unexpected error” message typically appears when the app cannot load its settings or connect to the underlying security services. Common triggers include:

  • Corrupted app cache or data files.
  • Outdated or conflicting third-party antivirus software.
  • Missing or damaged Windows system files.
  • Windows Update issues that leave security components in a broken state.
  • Group Policy or registry misconfigurations (less common on home editions).

The error can also appear after a feature update or when the Windows Security app itself is unregistered from the system.

Before You Start: Basic Checks

Try these quick steps first – they resolve a surprising number of cases:

  1. Restart your PC. A fresh boot often clears temporary glitches.
  2. Run Windows Update and install all pending updates, including optional ones.
  3. Make sure your PC’s date and time are correct – an incorrect clock can break security certificates.
  4. If you have third-party antivirus software, temporarily disable it to see if it’s interfering. If the error disappears, consider uninstalling it and sticking with Windows Security.

If the error persists, move on to the systematic fixes below.

Method 1: Repair or Reset Windows Security via Settings

Windows 11 includes a built-in repair tool for apps. This is the easiest fix and often works immediately.

  1. Open Settings (Win + I) → Apps → Installed apps.
  2. Scroll down to Windows Security (or search for it).
  3. Click the three-dot menu (⋯) next to it and select Advanced options.
  4. Scroll down to the Reset section.
  5. First click Repair – this will try to fix the app without deleting your data. Wait for it to finish, then reopen Windows Security.
  6. If the error remains, click Reset. This will delete the app’s data and restore default settings. You may need to re-enable some toggles afterward.

Note: Resetting Windows Security does not remove your files or personal data, but it will clear your custom exclusions and security settings.

Method 2: Re-register the Windows Security App with PowerShell

If resetting via Settings doesn’t work, the app may be unregistered from the system. Re-registering it using PowerShell is a reliable fix.

  1. Right-click the Start button and select Terminal (Admin) or Windows PowerShell (Admin).
  2. Copy and paste the following command, then press Enter:
Get-AppxPackage Microsoft.Windows.SecHealthUI | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
  1. Wait for the command to complete (it may take a minute).
  2. Close the terminal and try opening Windows Security again.

This command re-registers the app without affecting your system files. If you get an error about the package not being found, try the next method.

Method 3: Run System File Checker and DISM

Corrupted system files can cause Windows Security to fail. The System File Checker (SFC) and Deployment Imaging Service and Management Tool (DISM) are built-in tools that scan and repair these files.

  1. Open Terminal (Admin) as above.
  2. Run DISM /Online /Cleanup-Image /RestoreHealth and press Enter. This may take 10-20 minutes. Do not close the window.
  3. After DISM finishes, run sfc /scannow and press Enter. This will also take a while.
  4. Once both complete, restart your PC and check if Windows Security works.

These tools are safe and won’t delete personal files. If SFC finds issues it cannot fix, you may need to use the Windows 11 installation media to repair the system – a more advanced step.

Method 4: Check for Conflicting Third-Party Antivirus Software

Windows Security automatically disables itself when another antivirus is active. If you’ve uninstalled a third-party program recently, leftover drivers or services can still interfere.

  • Open Settings → Apps → Installed apps and look for any leftover antivirus tools. Uninstall them.
  • Use the vendor’s official removal tool if available (most major antivirus companies provide one).
  • Restart your PC and check Windows Security again.

If you still see the error, you can also check the Security Center service:

  1. Press Win + R, type services.msc, and press Enter.
  2. Find Security Center. Right-click it and select Restart.
  3. Set its Startup type to Automatic if it isn’t already.

Method 5: Use Windows Update Troubleshooter or Reset Windows

If none of the above work, the problem may lie deeper in the system. Two final options:

  • Run the Windows Update Troubleshooter: Go to Settings → System → Troubleshoot → Other troubleshooters → Windows Update → Run. This can fix update-related issues that break security components.
  • Repair install (in-place upgrade): Download the Windows 11 Installation Assistant from Microsoft’s official site and run it. This reinstalls Windows while keeping your files and apps. It’s a more thorough fix but takes about an hour.
  • Reset this PC: If all else fails, go to Settings → System → Recovery → Reset PC. Choose “Keep my files” to preserve personal data (apps will be removed).

Before doing a full reset, back up important files to an external drive or cloud storage.

Frequently Asked Questions

Will resetting Windows Security delete my antivirus protection?

No. Resetting the app only clears its settings and data. The underlying antivirus engine remains active and will continue to protect your PC in real time. After a reset, you may need to re-enable toggles like “Real-time protection” if they were turned off.

Why does Windows Security show “Unexpected error” after a Windows update?

Windows updates can occasionally leave the security app in a partially updated state. This usually happens when an update is interrupted or a driver conflicts. Running the repair/reset method or the DISM/SFC scan often resolves it.

Can I use third-party antivirus if Windows Security is broken?

Yes. You can install a reputable third-party antivirus program. Windows will automatically disable Windows Security’s real-time protection to avoid conflicts. However, it’s best to fix Windows Security so you have a fallback and to keep the firewall active.

Is it safe to run the PowerShell re-register command?

Yes. The command only re-registers the Windows Security app package with the system. It does not modify other apps or system files. It’s a standard troubleshooting step recommended by Microsoft support.

What if the error appears only when I open a specific tab (like Virus & threat protection)?

This often indicates a corrupted service or driver. Try restarting the “Security Center” service (as shown above) and then run DISM/SFC. If the problem persists, check if a third-party driver (e.g., a VPN or hardware security tool) is interfering.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →