Need machines not compliant by patch report for just patches in a label
There is a canned report "Machines not compliant by patch", but I need to limit it to just the patches in a particular label, say, "approved patches". How do I change the SQL to just look for the patches in that label? This should be trivial, but I can't get it.
Here is the SQL of the canned report:
SELECT PP.TITLE AS DISPLAY_NAME,
M.NAME AS ComputerName,
SYSTEM_DESCRIPTION, IP, MAC,
M.USER_LOGGED as USER_LOGGED,
FROM PATCHLINK_MACHINE_STATUS MS
JOIN KBSYS.PATCHLINK_PATCH PP ON PP.UID = MS.PATCHUID
JOIN MACHINE M ON M.ID = MS.MACHINE_ID
WHERE MS.STATUS = 'NOTPATCHED'
ORDER BY PP.TITLE