Query to show workstations that has a scan status

Query to show workstations that has a scan status

PGSQ & MSSQL:

Below query that will show the Assets that has a scan status.

select systeminfo.workstationname "Workstation Name",
LONGTODATE(audithistory.audittime) "Last Scanned on",
audithistory.auditstatus "Scan status"
from audithistory
left join systeminfo on systeminfo.workstationid=audithistory.workstationid
where audithistory.auditid in (Select max(audithistory.auditid) from audithistory group by workstationid)

 Below query shows only failed scan status.

select systeminfo.workstationname "Workstation Name",
LONGTODATE(audithistory.audittime) "Last Scanned on",
audithistory.auditstatus "Scan status"
from audithistory
left join systeminfo on systeminfo.workstationid=audithistory.workstationid
where audithistory.auditstatus!='SUCCESS'
and audithistory.auditid in (Select max(audithistory.auditid) from audithistory group by workstationid)

          • Related Articles

          • Query to show list of softwares with last scanned date and license key

            select systeminfo.workstationname "Workstation Name", SoftwareList.SOFTWARENAME "Software Name", LONGTODATE(SoftwareInfo.filecreatedtime) "Software Installed Date", LONGTODATE(audithistory.audittime) "Last Scanned Date" , sink.productkey "Scanned ...
          • Query to get the asset details , mac address , last scanned, status alone with user details

            Query to get the asset details , mac address , last scanned, status alone with user details SELECT Max(workstation.workstationname) "Asset Name",        Max(workstation.servicetag)      "Service Tag",        Max(resource.assettag)      "Asset Tag",   ...
          • Query to show all asset details_ MSSQL

            MSSQL: SELECT MAX("resource"."RESOURCENAME") AS "Asset Name", MAX("resource"."ASSETTAG") AS "Asset Tag",MAX(resource.SERIALNO) AS "Org Serial Number", MAX("product"."COMPONENTNAME") AS "Product", MAX("productType"."COMPONENTTYPENAME") AS "Product ...
          • SDP Scan offerings a glance

            There are several use cases to be addressed to scan user machines. Here are the solutions available with SDP now. - User machine rarely reaches the organization domain / Network (user login once a week using VPN and other times using local ...
          • Query to show the last worklog added in a ticket

            PGSQL: SELECT wo.WORKORDERID "Request ID",        max(aau.FIRST_NAME) "Requester",        max(wo.TITLE) "Subject",        max(qd.QUEUENAME) "Group",        max(ti.FIRST_NAME) "Assigned Technician",        MAX(cast((ct.TIMESPENT)/1000 * interval '1 ...