Privacy and Security Change Time to Clear Windows Security Protection History in Windows 11


  • Staff
Windows_Security_banner.png

The Protection History page in the Windows Security app is where you can go to view recommendations and actions that Microsoft Defender Antivirus has taken on your behalf, Potentially Unwanted Apps that have been removed, or key services (ex: SmartScreen) that are turned off.

Protection History only retains events for 15 days by default, after which they will automatically be cleared from history.

You can change the number of days to keep items in the scan history folder. After this time, Microsoft Defender removes the items. If you specify a value of zero, Microsoft Defender does not remove items.

This tutorial will show you how to change how many days to automatically clear Windows Security protection history in Windows 10 and Windows 11.


Contents

  • Option One: See Current Time to Clear Windows Security Protection History
  • Option Two: Change Time to Clear Windows Security Protection History


EXAMPLE: Windows Security Protection History

Windows_Security_protection_history.png





Option One

See Current Time to Clear Windows Security Protection History


1 Open Windows Terminal, and select Windows PowerShell.

2 Copy and paste the command below into PowerShell, and press Enter. (see screenshot below)

Get-MpPreference | Select-Object -Property ScanPurgeItemsAfterDelay

3 You will now see how many days (ex: "15") is currently set for the ScanPurgeItemsAfterDelay.

Get_ScanPurgeItemsAfterDelay.png





Option Two

Change Time to Clear Windows Security Protection History


You must be signed in as an administrator to use this option.


1 Open Windows Terminal (Admin), and select Windows PowerShell.

2 Type the command below into PowerShell, and press Enter. (see screenshot below)

Set-MpPreference -ScanPurgeItemsAfterDelay <days>

Substitute <days> in the command above with how many days you want to clear protection history after.

0 days = Protection history does not get automatically cleared.

15 days = Default.

For example: Set-MpPreference -ScanPurgeItemsAfterDelay 15


3 You can now close Windows Terminal (Admin) if you like.

Set_ScanPurgeItemsAfterDelay.png



That's it,
Shawn Brink


 

Attachments

  • Windows_Security.png
    Windows_Security.png
    6 KB · Views: 28
Last edited:
Top Bottom