Windows 10 Check from cmdline (with MSASCui or MpCmdRun) if Defender is running?

tobwen

Active Member
How can I check from command line if Defender is currently enabled?

How can I check from command line if Defender is currently enabled AND RealTimeProtection enabled?

I don't know if the tools MSASCui.exe and MpCmdRun.exe are suitable for this task.

If Defender is disabled they probably don't work and can not return a result.

So maybe a Powershell command or other would be more suitable
 
if((Get-Service -Name WinDefend).Status -ne "Running") { Write-Output "Defender Service not running" } else { Get-MpComputerStatus }
 
Back
Top