Mariusz, Gorzoch tech Blog

Get me the list of installed HotFixes

leave a comment »

My today post will be connected to the previous one and it is about how to enumerate all installed HotFixes in the system. Few days ago I came across strange problem with SharePoint and as a result of my search I found that it can be resolved only thru instllation of one special HotFix. Sound quite easy?!?!… yes you can say it is, but how to findout if particular KB is not already installed in the system. And here we get to the point! How to do it ? Lucky if you are using PowerShell this is really ease task with use of WMI object called "Win32_QuickFixEngineering". The main point is to create query to this object and get the list of installed HotFixes:
$hf = get-wmiobject -class "Win32_QuickFixEngineering" -namespace "root\CIMV2"
now variable $hf contain array of all installed hot fixes. Each entry in this array contain structure like this:
Caption             :
CSName              : WHMPPLGDN0057
Description         :
FixComments         :
HotFixID            : File 1
InstallDate         :
InstalledBy         :
InstalledOn         :
Name                :
ServicePackInEffect : KB896358
and to check if particular KB/HotFix is installed we just need to filter array items by field "HotFixID". With use of PowerShell this can be done by:
$hf | where-object { $_.HotFixID -eq "KB896423" }
if you get some result, then particular HotFix/KB is installed on your computer (in my case I’m checking if KB896423 is installed) and if not, it means it is not installed.

Written by Mariusz Gorzoch

11 June 2009 at 22:18

Posted in Tip&Trick

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: