0

I want to delete the Windows Defender History in Windows 11 22H2 22621.2215. In particular, accessing the folder C:\ProgramData\Microsoft\Windows Defender\Scans is not possible. It seems that Microsoft has specially secured access to this folder. How to clear Defender history anyway? A PowerShell script would be nice.

All previously published Howtos are not succesfull. eg https://techviral.net/clear-microsoft-defender-protection-history/ is not successfull.

You cannot take ownership of the folder through the Windows Explorer. Using an administrative command line allows you to switch to the Scans folder, but the system also prevents you from deleting the History subfolder.

Michael.H
  • 1
  • 2

1 Answers1

-1

Here's a PowerShell script to clear Windows Defender history on Windows 11. This script stops the Windows Defender service, deletes the history folder, and then restarts the service:

Stop Windows Defender service

Stop-Service -Name WinDefend

Specify the path to the Windows Defender history folder

$DefenderHistoryPath = "C:\ProgramData\Microsoft\Windows Defender\Scans\History"

Delete the history folder and its contents

Remove-Item -Path $DefenderHistoryPath -Force -Recurse

Start Windows Defender service

Start-Service -Name WinDefend

Please note that this script requires administrator privileges to run successfully. Also, it's important to emphasize that clearing Windows Defender history should not be done without a valid reason, as it can potentially impact your system's security. Regularly clearing the history is not recommended. Only do this if you suspect a specific issue related to the history data.

Jack
  • 1