Created
August 16, 2021 01:22
-
-
Save kism/b1c965a992b129e069e7226e9d5bee4d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Hosts = @( | |
#("host1"), | |
#("host2"), | |
#("host3"), | |
("dpshub.kg.lan") | |
) | |
$hoststatusscript = { | |
$avstatus = Get-MpComputerStatus | |
write-host -NoNewline "Anti-Virus System: " | |
if ($avstatus.AntivirusEnabled) { | |
write-host "Age:" $avstatus.AntispywareSignatureAge "Version:" $avstatus.AntispywareSignatureVersion | |
} else { | |
write-host -ForegroundColor Red "Disabled!" | |
} | |
write-host -NoNewline "Anti-Spyware System: " | |
if ($avstatus.NISEnabled) { | |
write-host "Age:" $avstatus.NISSignatureAge "Version:" $avstatus.NISEngineVersion | |
} else { | |
write-host -ForegroundColor Red "Disabled!" | |
} | |
write-host -NoNewline "Network Inspection System: " | |
if ($avstatus.AntispywareEnabled) { | |
write-host "Age:" $avstatus.AntispywareSignatureAge "Version:" $avstatus.AntispywareSignatureVersion | |
} else { | |
write-host -ForegroundColor Red "Disabled!" | |
} | |
} | |
ForEach ($inHost in $Hosts) { | |
Write-Host "Host: $inHost" | |
Invoke-Command -ComputerName $Host -ScriptBlock $hoststatusscript | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment