mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-24 03:27:40 -05:00
fix defender and add defender to console command
Signed-off-by: si458 <simonsmith5521@gmail.com>
This commit is contained in:
@@ -244,7 +244,10 @@ function defender(){
|
||||
try {
|
||||
var tokens = require('win-wmi').query('ROOT\\Microsoft\\Windows\\Defender', 'SELECT * FROM MSFT_MpComputerStatus', ['RealTimeProtectionEnabled','IsTamperProtected','AntivirusSignatureVersion','AntivirusSignatureLastUpdated']);
|
||||
if (tokens[0]){
|
||||
return ({ RealTimeProtection: tokens[0].RealTimeProtectionEnabled, TamperProtected: tokens[0].IsTamperProtected, AntivirusSignatureVersion: tokens[0].AntivirusSignatureVersion, AntivirusSignatureLastUpdated: tokens[0].AntivirusSignatureLastUpdated });
|
||||
var info = { RealTimeProtection: tokens[0].RealTimeProtectionEnabled, TamperProtected: tokens[0].IsTamperProtected };
|
||||
if (tokens[0].AntivirusSignatureVersion) { info.AntivirusSignatureVersion = tokens[0].AntivirusSignatureVersion; }
|
||||
if (tokens[0].AntivirusSignatureLastUpdated) { info.AntivirusSignatureLastUpdated = tokens[0].AntivirusSignatureLastUpdated; }
|
||||
return (info);
|
||||
} else {
|
||||
return ({});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user