There are always times when you need to be able to compare the MS hotfixes on one machine to another machine, examples being:
- Computer has no internet access
- Hotfixes or patches have been applied that are not available on Windows Update
Obtain the two lists
Command Prompt:
Wmic qfe get hotfixid
To output this to a file:
Wmic qfe get hotfixid > c:\HotfixList.txt
Powershell:
get-hotfix |select-object hotfixid c:\HotfixList.txt
Compare the two lists
- Open up the two lists in Notepad
- Open up a blank Excel workbook
- Copy and paste the contents into two separate columns
Now the problem here is both columns have contents that have trailing spaces… so
- Press Ctrl-A to select the whole sheet
- Press Ctrl F and chose to replace a space with nothing (i.e. in replace tab , click on “find what” and press the space bar once. Then press the “replace all” button
- Sort each column (a-z) – the is important for the vlookup we are going to use
So what does the Vlookup function in excel do?
Put simply – VLOOKUP retrieves information from a database/list (a row or rows) based on a supplied instance of the unique identifier (what is in a specific cell).
So now Select B1 ,then hover the mouse over the green square in the bottom right corner and click and hold it, and drag it down the column. Release it and you will find the column has been automatically populated with formula
The cells in column B that have #N/A indicates the contents in cell F(x) do not exist in column H
In the example above KB2887595 does not exist in column H
So there you have it an easy way to find out what hotfixes that are in “Computer F” are missing in “Computer H”