Thursday, March 19, 2015

wmi query to check installed windows updates

When deploying applications using SCCM task sequence, an application may have prerequisite of an windows update (KB). So if we add that required KB to the task sequence the step will fail if it is already installed. So the logic should be, check whether the KB installed or not and install only if it is not installed.
We can perform this check using VBScript or batch script.
However, we can use a simple WMI query and create a condition if none is true in the task sequence.

The WMI query to check the KB installed or not is;
SELECT * FROM Win32_QuickFixEngineering WHERE HotFixID = "KBxxxxxx"

The nominated step will execute only if KBxxxxxx is not installed. Replace the KBxxxxxx with required KB.

No comments:

Post a Comment