defender update & scan

# Check if running as Administrator
if (-NOT ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator"))
{
    Write-Host "This script requires administrative privileges."
    exit
}

# Define the path to MpCmdRun.exe
$mpCmdRun = Join-Path $env:ProgramFiles "Windows Defender\MpCmdRun.exe"

# Validate MAPS Connection
& $mpCmdRun -ValidateMapsConnection

# List All Dynamic Signatures
& $mpCmdRun -ListAllDynamicSignatures

# Remove Dynamic Signatures
& $mpCmdRun -removedefinitions -dynamicsignatures

# Signature Update
& $mpCmdRun -SignatureUpdate

# List All Dynamic Signatures again
& $mpCmdRun -ListAllDynamicSignatures

# Quick Scan with CPU Throttling
& $mpCmdRun -Scan -ScanType 1 -CpuThrottling

# Full Scan with CPU Throttling
& $mpCmdRun -Scan -ScanType 2 -CpuThrottling

# Boot Sector Scan with CPU Throttling
& $mpCmdRun -Scan -ScanType 3 -CpuThrottling

Leave a Reply

Your email address will not be published. Required fields are marked *