Files
PowerShell/Detect-ActiveDesktop.ps1
T

11 lines
273 B
PowerShell

#This works only if Defender has not been disabled on the system.
$proc = Get-Process -Name SecurityHealthSystray -ErrorAction SilentlyContinue
if ($null -ne $proc) {
Write-Output "desktop-not-active"
exit 0
} else {
Write-Output "desktop-active"
exit 0
}