Skip to content
high severityMicrosoft Defender XDR

Detect shadow copy deletion (KQL)

Deleting volume shadow copies stops victims restoring files from local snapshots, so ransomware almost always does it just before or during encryption. This DeviceProcessEvents query matches the common deletion commands — vssadmin delete shadows, wmic shadowcopy delete, wbadmin delete and the PowerShell Win32_ShadowCopy path.

A hit is high severity: outside a few backup-administration edge cases, destroying shadow copies is almost always malicious and time-critical.

The query

DeviceProcessEvents
| where Timestamp > ago(7d)
| where (FileName =~ "vssadmin.exe" and ProcessCommandLine has "delete" and ProcessCommandLine has "shadows")
    or (FileName =~ "wmic.exe" and ProcessCommandLine has "shadowcopy" and ProcessCommandLine has "delete")
    or (FileName =~ "wbadmin.exe" and ProcessCommandLine has "delete")
    or (FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has "Win32_ShadowCopy")
| project Timestamp, DeviceName, AccountName,
          InitiatingProcessFileName, InitiatingProcessCommandLine, ProcessCommandLine
| sort by Timestamp desc

Line-by-line explanation

  • FileName =~ "vssadmin.exe" and ProcessCommandLine has "delete" ... "shadows"

    vssadmin delete shadows is the textbook command ransomware uses to remove snapshots.

  • FileName =~ "wmic.exe" and ProcessCommandLine has "shadowcopy" ... "delete"

    wmic shadowcopy delete achieves the same through WMI, a frequent variant.

  • FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has "Win32_ShadowCopy"

    Catches the PowerShell approach that enumerates and deletes shadow copies via the Win32_ShadowCopy WMI class.

Required tables and columns

  • FileNameThe binary performing the deletion (vssadmin, wmic, wbadmin or a PowerShell host).
  • ProcessCommandLineCommand line proving the shadow-copy deletion intent.
  • InitiatingProcessFileNameThe parent process, often a script or dropped executable during ransomware.
  • DeviceNameThe affected host — act fast, encryption may be imminent.

MITRE ATT&CK mapping

Tuning and false positives

  • This should be near-zero in a healthy environment; investigate every hit rather than threshold it.
  • Exclude only vetted backup-maintenance automation, scoped tightly by host and command pattern.

Limitations

  • bcdedit recovery tampering and wbadmin catalog deletion are related impact actions that may warrant their own queries.
  • Renamed binaries evade the FileName filter; add original-file-name checks for hardened coverage.

References

Last reviewed 2026-11-18.