Looking to automate a report on Daily Scan results, can't find anything within the Report tab,
Any ideas welcome .
Cheers,
LS
This thread was automatically locked due to age.
Hello LS,
there's no documentation, the following Q&D (I'm about to leave for three weeks, so ...) code should give you all the scans completed in the last 24 hours:
SELECT Name ,LastScanName ,LastScanDateTime FROM ComputersAndDeletedComputers WHERE DATEDIFF(hour,LastScanDateTime,SYSDATETIME()) < 24 /* Uncomment to get only a specific scan AND LastScanName='Daily Scan' */
and this failed scans (as far as I can see the error is the same whether the scan aborted or has been cancelled by an admin):
SELECT c.Name ,e.Insert1 AS LastScanName ,e.AlertTime AS LastScanDateTime FROM Errors as e INNER JOIN ComputersAndDeletedComputers as c ON c.id = e.ComputerID WHERE DATEDIFF(hour,LastScanDateTime,SYSDATETIME()) < 24 AND e.Source = 'SAV' AND e.Number=539492364
/* Uncomment to get only a specific scan
AND
LastScanName='Daily Scan'
*/
For a simple way to run this please see this post. Getting the details of the related errors is tricky (and can't be done on a Friday afternoon)
HTH
Christian
Hello LS,
there's no documentation, the following Q&D (I'm about to leave for three weeks, so ...) code should give you all the scans completed in the last 24 hours:
SELECT Name ,LastScanName ,LastScanDateTime FROM ComputersAndDeletedComputers WHERE DATEDIFF(hour,LastScanDateTime,SYSDATETIME()) < 24 /* Uncomment to get only a specific scan AND LastScanName='Daily Scan' */
and this failed scans (as far as I can see the error is the same whether the scan aborted or has been cancelled by an admin):
SELECT c.Name ,e.Insert1 AS LastScanName ,e.AlertTime AS LastScanDateTime FROM Errors as e INNER JOIN ComputersAndDeletedComputers as c ON c.id = e.ComputerID WHERE DATEDIFF(hour,LastScanDateTime,SYSDATETIME()) < 24 AND e.Source = 'SAV' AND e.Number=539492364
/* Uncomment to get only a specific scan
AND
LastScanName='Daily Scan'
*/
For a simple way to run this please see this post. Getting the details of the related errors is tricky (and can't be done on a Friday afternoon)
HTH
Christian