
🛡️ Windows Defender Management Commands
✅ Check if Defender is Running
PowerShell
Get-Service -Name WinDefend
📅 Check Last Update Time
PowerShell
Get-MpComputerStatus | Select-Object AntivirusSignatureLastUpdated
🔄 Force Update Definitions
PowerShell
Update-MpSignature
🧠 Check Overall Defender Status
PowerShell
Get-MpComputerStatus
🚀 Run a Quick Scan
PowerShell
Start-MpScan -ScanType QuickScan
🧹 Run a Full Scan
PowerShell
Start-MpScan -ScanType FullScan
📂 Exclude a Folder
PowerShell
Add-MpPreference -ExclusionPath “C:\Your\Folder\Path”
📄 Exclude a File
PowerShell
Add-MpPreference -ExclusionProcess “C:\Your\Folder\app.exe”
🧩 Exclude a File Extension
PowerShell
Add-MpPreference -ExclusionExtension “.log”
❌ Remove Folder Exclusion
PowerShell
Remove-MpPreference -ExclusionPath “C:\Your\Folder\Path”
📋 View All Exclusions
PowerShell
Get-MpPreference | Select-Object -ExpandProperty Exclusion*
⏸️ Disable Real-Time Protection
PowerShell
Set-MpPreference -DisableRealtimeMonitoring $true
▶️ Re-enable Real-Time Protection
PowerShell
Set-MpPreference -DisableRealtimeMonitoring $false
🛡️ Enable Defender Tray Icon on Windows Server
PowerShell
Set-MpPreference -UILockdown $false
🧠 Registry Tweak (Optional)
Registry Path
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\UX Configuration
DWORD Value
Notification_Systray = 1
After applying these, restart or log off to see the Defender shield icon in your system tray. This works on Windows Server 2016, 2019, and 2022.
🧭 Force Update via CMD
Command Prompt
“%ProgramFiles%\Windows Defender\MpCmdRun.exe” -SignatureUpdate
🧭 Run Quick Scan via CMD
Command Prompt
“%ProgramFiles%\Windows Defender\MpCmdRun.exe” -Scan -ScanType 1
🧭 Run Full Scan via CMD
Command Prompt
“%ProgramFiles%\Windows Defender\MpCmdRun.exe” -Scan -ScanType 2
These commands help you ritualize Defender’s vigilance—ensuring your server remains clean, updated, and ready to archive without interruption.