12 April 2012

List Installed Windows 7 Updates

Posted By: Mick Pletcher - 11:02 AM

Share

& Comment

You are looking for a list of all installed updates on a machine for either identifying what has not been installed, or like myself, to find the list so that you know what is needed to download to include in the MDT/SCCM build. I have written this VBScript that will parse through and output all installed updates on a Windows 7 machine. The output is in csv format so that it can easily be opened up in Microsoft Excel.

Here is a link to the file for downloading and the code is just below:

   
 '*******************************************************************************  
 '     Program: ListUpdates.vbs  
 '      Author: Mick Pletcher  
 '        Date: 12 April 2012  
 '    Modified:  
 '  
 ' Description: This will output a list of all installed updates to a csv file  
 '*******************************************************************************  
 REM Define Local Variables  
 DIM strComputer : strComputer = "."  
    
 REM Define Local Objects  
 DIM FSO           : Set FSO = CreateObject("Scripting.FileSystemObject")  
 DIM objFile       : Set objFile = FSO.CreateTextFile("Updates.csv", True)  
 DIM objHotfixFile : Set objHotfixFile = FSO.OpenTextFile("Updates.csv", 1,True)  
 DIM objWMIService : Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" _  
                     & strComputer & "\root\cimv2")  
 DIM colQuickFixes : Set colQuickFixes = objWMIService.ExecQuery _  
                     ("Select * from Win32_QuickFixEngineering")  
   
    
 For Each objQuickFix in colQuickFixes  
      objFile.WriteLine(objQuickFix.Description & Chr(44) & objQuickFix.HotFixID)  
 Next  
 Wscript.Echo "Done"  
 objFile.Close  
   
 REM Cleanup Local Objects and Variables  
 Set colQuickFixes = Nothing  
 Set FSO           = Nothing  
 Set objFile       = Nothing  
 Set objHotfixFile = Nothing  
 Set objWMIService = Nothing  
 Set strComputer   = Nothing  

About Mick Pletcher

My blog is here to help solve issues I have encountered and solved, publish scripts I have written, and educate others in understanding areas that are not well covered

0 comments:

Post a Comment

Copyright © 2013 Mick's IT Blogs™ is a registered trademark.