Create Smart Label to patch computers and remove patches after 45 days
Good morning guys, I been playing with smart labels and patching, so far is good. I created my smart labels for patching but I need help to remove old patches from label after 45 days and add new patches automatically. I believe smart label is adding new patches since that is why we use smart labels. I know I have to add a line to the SQL, something like interval (45), but I been going crazy, since it is not working properly. Has any one done something similar? I apreciate the help, thanks.
3 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
hmoore
10 years ago
select UID from KBSYS.PATCHLINK_PATCH
where (select 1 from PATCHLINK_PATCH_STATUS where PATCHLINK_PATCH.UID = PATCHLINK_PATCH_STATUS.PATCHUID and PATCHLINK_PATCH_STATUS.STATUS in (0))
and RELEASEDATE > DATE_SUB(now(), INTERVAL 30 DAY)
_______________________________________________
I use this one for just Win 7 x64
select UID from KBSYS.PATCHLINK_PATCH where (((( (((1 in (select 1 from KBSYS.PATCHLINK_LST, KBSYS.PATCHLINK_LST_PATCH_JT where KBSYS.PATCHLINK_PATCH.UID = KBSYS.PATCHLINK_LST_PATCH_JT.PATCHUID and KBSYS.PATCHLINK_LST_PATCH_JT.LST_ID = KBSYS.PATCHLINK_LST.ID and KBSYS.PATCHLINK_LST.ID in (301,303,305,304,306,307,308,309,315,317,314,311,312,101,33) )) ) and ((1 in (select 1 from KBSYS.PATCHLINK_LST, KBSYS.PATCHLINK_PACKAGE, KBSYS.PATCHLINK_PACKAGE_OS_TYPE_JT where KBSYS.PATCHLINK_PATCH.UID = KBSYS.PATCHLINK_PACKAGE.PATCHUID and KBSYS.PATCHLINK_PACKAGE.FILENAME = KBSYS.PATCHLINK_PACKAGE_OS_TYPE_JT.FILENAME and KBSYS.PATCHLINK_PACKAGE_OS_TYPE_JT.OS_TYPE_ID = KBSYS.PATCHLINK_LST.OS_TYPE_ID and KBSYS.PATCHLINK_LST.ID in (301,303,305,304,306,307,308,309,315,317,314,311,312,101,33) )) ))) AND KBSYS.PATCHLINK_PATCH.IMPACTID in ('Critical') ) AND KBSYS.PATCHLINK_PATCH.IS_APP in (0) ) AND KBSYS.PATCHLINK_PATCH.RELEASEDATE > DATE_SUB(CURDATE(), INTERVAL 30 DAY)) - nshah 10 years ago
This will only download the patches you need in the labels.
It keeps your patching footprint small.
AND! it is flexible, so if you install a new system with an outdated patch level it will patch automaticly to the most current without interaction. If you do it like you want, you need to patch it by hand to a minimum patch level. - Nico_K 10 years ago