/build/static/layout/Breadcrumb_cap_w.png

Need help with a script

Good morning,

I am trying to figure out how to write a script that will allow me to list every computer in my device inventory that is missing a specific patch. I have a script to show every computer that has the specified patch installed, but can't seem to figure out how to get the opposite; every computer that does NOT have this patch installed. The patch in question is KB4534293, and its specific for Windows 10 version 1803.


Thank you


0 Comments   [ + ] Show comments

Answers (1)

Answer Summary:
Posted by: ajones88 4 years ago
Senior White Belt
2

Top Answer

Hey Josh,

I just did this last week, here is what I used. In this case I chose to use a smart label instead of a report, so that I can more easily target these machines for patching, but the same SQL query should work for your report. In this case there is a list of patches because they all fixed the same CVE-2020-0601 that Microsoft patched the other week, just a different update depending on OS. You could remove all the patches in the brackets and just insert the one that you are looking to check.


SELECT MACHINE_ID as TOPIC_ID,

KBSYS.PATCH.TITLE AS PATCH,

MACHINE.NAME AS MACHINE,

IP

FROM PATCH_MACHINE_STATUS

JOIN KBSYS.PATCH ON (KBSYS.PATCH.ID = PATCH_MACHINE_STATUS.PATCH_ID)

JOIN MACHINE ON (MACHINE.ID = PATCH_MACHINE_STATUS.MACHINE_ID)


WHERE

KBSYS.PATCH.PATCH_IDENTIFIER IN ('KB4534306','KB4534306','KB4534271','KB4534271','KB4534276','KB4534276','KB4534276','KB4534293','KB4534293','KB4534293','KB4534273','KB4534273','KB4534273','KB4528760','KB4528760','KB4528760','KB4528760','KB4528760','KB4528760','KB4534271','KB4534271','KB4534273','KB4534273','KB4534293','KB4528760','KB4528760')

AND

PATCH_MACHINE_STATUS.PATCH_INSTALLED = 0

AND

KBSYS.PATCH.IS_SUPERCEDED = 0

AND

PATCH_MACHINE_STATUS.PATCH_APPLICABLE = 1


GROUP BY MACHINE.ID



Comments:

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

View more:

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ