Monday, September 13, 2010

Find SMS Client Machines with NULL hardware inventory

SELECT DISTINCT
a.Name0,
a.resourceid,
a.Creation_date0,
a.Obsolete0,
a.Client0,
a.Active0,
b.LastScandate AS LastSWscan,
c.LastHWscan
FROM v_r_system AS a
LEFT OUTER JOIN v_GS_LastSoftwareScan AS b
ON a.resourceid = b.resourceid
LEFT OUTER JOIN v_GS_WORKSTATION_STATUS AS c
ON a.resourceid = c.resourceid
WHERE a.Name0 IN (SELECT Name0
FROM v_r_system
GROUP BY Name0
HAVING COUNT(*) < 2)
AND (c.LastHWscan is NULL and a.Client0 =1 and a.Obsolete0=0)
ORDER BY c.LastHWscan, b.LastScandate desc

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

Links to this post:

Create a Link

<< Home