Discovering what hotfixes are on your PC, via WMI

There are several ways to list what hotfixes are on your PC, such as looking in the registry, running MBSA, or visiting the Windows Update site.

An easier way is to use WMI, which you can run from a command line.  Which is handy, as you can also run it against remote computers.  Computers you can’t interactively logon to.  Such as servers.

So, on a command line, type wmic qfe list brief ,and press Enter.
wmic qfe list brief

So what if you just want to check that you have a particular patch, for example KB970789?

wmic qfe list brief | find /i “789”
wmic qfe list brief | find /i "789"

Other things you can do,

  • wmic qfe
    to get a list of all the hotfix fields WMI knows about.
    (Caption, CSName, Description, FixComments, HotFixID, InstallDate, InstalledBy, InstalledOn, Name, ServicePackInEffect, Status)
  • wmic qfe get csname,hotfixid,installedon
    to get individual/selected fields
  • wmic /output:c:\temp\qfe.csv qfe get hotfixid,installedon /format:csv
    to write that list out to a file called qfe.csv
    Windows 7 RC bug: if you specify the /format switch, you’ll get a “Invalid XSL format (or) file name.” error.
  • wmic /node:”EMMA-ROID” /output:c:\temp\qfe_emmapc.csv QFE GET hotfixid,installedon /format:csv
    Note: you need the quotes around the computer name.
  • wmic /node:@systems_to_check.txt /output:c:\temp\qfe_systemstocheck.csv QFE GET hotfixid,installedon /format:csv

Credit: Jonathan’s Virtual Blog @ TechNet: Are All of My Servers Really Up to Date?

Bookmark and Share