Report - patch reboot info, what is the variable?
I would like to add a field for patch reboot info (none, recommended, or required). I was wondering if someone could tell me what the PP.*** variable is for that?
My report is similar to the one here:
http://www.kace.com/support/resources/kb/article/Patching-Report-To-list-all-active-critical-patches
Select M.NAME as MACHINE_NAME,
PP.TITLE AS PATCH_NAME,
PP.IMPACTID AS IMPACT,
CASE WHEN MS.STATUS='PATCHED' THEN 'Installed'
WHEN MS.STATUS='NOTPATCHED' THEN 'Not Installed'
END AS 'PATCHED STATUS'
FROM PATCHLINK_MACHINE_STATUS MS
JOIN MACHINE M ON M.ID = MS.MACHINE_ID
JOIN KBSYS.PATCHLINK_PATCH PP ON PP.UID = MS.PATCHUID
JOIN PATCHLINK_PATCH_STATUS PPS ON PPS.PATCHUID = PP.UID
AND PP.IMPACTID = ('Critical')
AND PPS.STATUS = 0 /* 0=active patches */
order by MACHINE_NAME, PP.TITLE
Answers (2)
Have a look in KBSYS.PATCHLINK_VENDORATTRIBUTE.
This should contain a patch UID, an ATTR, and ATTRVALUE.
An example of using this:
--------------------
select UID, PP.TITLE,PP.UID,PP.*,OST.* from KBSYS.PATCHLINK_PATCH PP join KBSYS.PATCHLINK_PACKAGE PPKG on PPKG.PATCHUID = PP.UID join KBSYS.PATCHLINK_PACKAGE_OS_TYPE_JT OSJT on OSJT.FILENAME = PPKG.FILENAME join KBSYS.PATCHLINK_OS_TYPE OST on OST.ID = OSJT.OS_TYPE_ID join KBSYS.PATCHLINK_VENDORATTRIBUTE PVA on PVA.PATCHUID = PP.UID where (PVA.ATTR='Reboot' and PVA.ATTRVALUE='None') and PP.VENDOR like '%Microsoft%' and OST.OS_TYPE like '%win7%' group by PP.UID
---------------------------
The group by at the bottom is because any particular patch could have several filenames associated with it (due to different files being applied to 32/64 bit, the same patch ID having different packages applied to win7/server2012, various other conditions)