This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Daily Scan Report

Looking to automate a report on Daily Scan results, can't find anything within the Report tab,

Any ideas welcome .

Cheers,

LS

:58104


This thread was automatically locked due to age.
Parents
  • 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

    :58172
Reply
  • 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

    :58172
Children
No Data