sodcalculator

10 Tech How-To

Unexpected Error Windows Defender? Fix It

Guide 10-9635 · Updated · Step by step

If you see an “Unexpected error� message in Windows Defender (now called Windows Security), it usually means the Security Center service is stopped or a component is corrupted, and you can fix it by restarting the service or running the built-in troubleshooting tools. This guide walks you through the most common causes and step-by-step fixes, from simple restarts to deeper system file repairs.

What the “Unexpected Error� Actually Means

Windows Security (the modern name for Windows Defender) is a built-in antivirus and firewall suite. When it fails to open or shows an error, the message often reads “Unexpected error. Sorry, we ran into a problem� or “Page unavailable.� This happens when the Windows Security Center service (SecurityHealthService) stops, when the Windows Defender Antivirus service is disabled, or when a system file needed by the security interface is damaged. It can also appear after a major Windows update, a third-party antivirus conflict, or a corrupted user profile.

Quick Fixes to Try First

Start with these simple steps—they resolve a large share of cases without touching advanced settings.

  • Restart your PC. A full restart reinitializes all Windows services, including those that manage security.
  • Run Windows Update. Go to Settings > Update & Security > Windows Update and click “Check for updates.â€� Install any pending updates, then restart.
  • Use the Windows Security app’s built-in repair. Open Settings > Apps > Apps & features, find “Windows Security,â€� click Advanced options, then click “Repair.â€� If that doesn’t work, click “Reset.â€�
  • Check for third-party antivirus. If you recently installed another antivirus, uninstall it (or disable its real-time protection) and see if the error clears. Windows Security often disables itself when another AV is active.

Restart the Security Center Service

The most common cause is the Security Center service being stopped or set to “Manual� when it should be “Automatic.� Here’s how to fix it:

  1. Press Win + R, type services.msc, and press Enter.
  2. Scroll to Security Center (it may be listed as “SecurityCenter� or “wscsvc�).
  3. Right-click it and select Properties.
  4. Set Startup type to Automatic (or Automatic (Delayed Start)).
  5. If the service is not running, click Start.
  6. Click Apply and OK, then close the Services window and try opening Windows Security again.

If the service fails to start, note the error code (e.g., 5, 1058, 1068). Error 5 usually means a permissions issue; error 1058 means the service is disabled; error 1068 indicates a dependency problem. You may need to check the “Dependencies� tab in the service properties and ensure those services (like Remote Procedure Call) are running.

Run the Windows Security Troubleshooter

Windows includes a dedicated troubleshooter for Windows Security. To run it:

  1. Open Settings > Update & Security > Troubleshoot (or System > Troubleshoot in newer versions).
  2. Select Additional troubleshooters.
  3. Find Windows Security (or “System Maintenance� if that’s all you see) and click Run the troubleshooter.
  4. Follow the on-screen instructions. It may automatically restart services or repair corrupted settings.

Repair Corrupted System Files

If the above doesn’t work, the issue may be deeper—corrupted system files or a damaged Windows Security store. Use the System File Checker (SFC) and DISM tools:

  1. Open Command Prompt as administrator: right-click the Start button and select Command Prompt (Admin) or Windows Terminal (Admin).
  2. Type sfc /scannow and press Enter. Wait for the scan to finish (it can take 10–20 minutes).
  3. If SFC finds issues but can’t fix them, run DISM /Online /Cleanup-Image /RestoreHealth and press Enter. This repairs the Windows image.
  4. Restart your PC and try Windows Security again.

If SFC still reports errors, you may need to perform a Windows repair installation (keep your files) or use the “Startup Repair� from the recovery environment.

Re-register the Windows Security App

Sometimes the app itself is misregistered. You can re-register it with PowerShell:

  1. Right-click the Start button and select Windows PowerShell (Admin) or Terminal (Admin).
  2. Copy and paste this command, then press Enter:
    Get-AppxPackage Microsoft.SecHealthUI -AllUsers | Reset-AppxPackage
  3. Wait for it to finish, then restart your PC.

This command resets the Windows Security app without deleting your antivirus definitions or settings.

Check Group Policy and Registry Settings

If you’re on Windows Pro or Enterprise, a Group Policy setting might be disabling Windows Defender. Press Win + R, type gpedit.msc, and navigate to Computer Configuration > Administrative Templates > Windows Components > Windows Defender Antivirus. Look for “Turn off Windows Defender Antivirus� and set it to Not Configured or Disabled.

For registry users (all editions), open regedit and go to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows Defender. If there is a value named DisableAntiSpyware set to 1, change it to 0 or delete it. Restart your PC afterward.

When Nothing Works: Reset Windows Security or Reinstall

If you’ve tried all the above and the error persists, you can reset the Windows Security app from Settings (as described in the quick fixes) or, as a last resort, perform a “Reset this PC� while keeping your files. That reinstalls Windows and should restore all security components. Before doing that, back up your important data.

Frequently Asked Questions

Why does Windows Defender say “Unexpected error� after an update?

Windows updates sometimes change service configurations or leave corrupted files. Restarting the Security Center service or running the SFC scan usually resolves it. If not, check for a pending update that failed to install.

Can a third-party antivirus cause this error?

Yes. When another antivirus is installed, Windows Security often disables itself to avoid conflicts. If the third-party AV is uninstalled improperly, it can leave Windows Defender in a broken state. Uninstall the third-party AV using its official removal tool, then restart.

Will resetting the Windows Security app delete my antivirus settings?

Resetting the app restores default settings, so custom exclusions or notifications will be lost. However, your virus definitions and real-time protection will remain active. You’ll need to re-add any exclusions after a reset.

Is it safe to use a third-party antivirus instead of fixing Windows Defender?

Yes, but only if you keep the third-party AV up to date and enable real-time protection. However, it’s best to fix Windows Defender because it’s integrated with the OS and provides baseline protection that other tools rely on.

Does this error mean my PC is infected?

Not necessarily. The error is usually a software glitch, not a sign of malware. Still, if you suspect an infection, run a scan with Microsoft Defender Offline (available in the Windows Security app) or a reputable on-demand scanner.

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 →