Report showing the date the last time a computer had patches deployed
I'm looking for help creating a report for my KACE K1000 (v.6.0.101863) that would show a list of all the computers in my inventory and the date the last time patches were deployed to them. Either that, or a report showing the number of how many patches each computer is missing. I'm looking for a way to find out which machines aren't being patched regularly.
Thanks!
0 Comments
[ + ] Show comments
Answers (1)
Please log in to answer
Posted by:
htomlinson
10 years ago
Assuming that you can't use kace for windows updates like me, an easier option might be running a script that counts and/or gives you a list of what is installed. You could then create a custom inventory based on that file. Then you could run a report and sort by the number of patches installed or by looking for a recent patch.
Try something along these lines of this vb script.
Try something along these lines of this vb script.
'#==============================================================================
'#==============================================================================
'# SCRIPT.........: CountUpdates.vbs
'# VERSION........: 1.0
'# DATE...........: 02/21/2014
'# DESCRIPTION....: Counts all installed updates / hotfixes on PC in a text file
'#
'#==============================================================================
'#==============================================================================
Option Explicit
'On Error Resume Next
Dim oShell, oFileSystem, oRunLog, oWMIService, colQuickFixes, oItem, oOSVersion
Dim iUpdateCount, idx
Dim strFileName, strLoggingPath, strLogFileAndPath, strPCName, strHotfixID, strLastHotfixID, strVersion
Dim strList, strListFileAndPath
'Get Version Number of OS to make sure that
Set oShell = CreateObject("WScript.Shell")
Set oOSVersion = oShell.exec("%comspec% /c ver")
strVersion = oOSVersion.stdout.readall
'Get PC Name
strPCName = oShell.ExpandEnvironmentStrings("%COMPUTERNAME%")
'Create file system object
strFileName = "CountUpdates.log"
strLoggingPath = "C:\Logs\"
Set oFileSystem = CreateObject("Scripting.FileSystemObject")
'Create Log Directory if it does not exist
If (NOT oFileSystem.FolderExists(strLoggingPath)) Then
oFileSystem.CreateFolder(strLoggingPath)
End If
'Log File Path and Name
strLogFileAndPath = strLoggingPath & strFileName
'Create Logging File if it does not exist
If (oFileSystem.FileExists(strLogFileAndPath)) Then
oFileSystem.DeleteFile(strLogFileAndPath)
End If
Set oRunLog = oFileSystem.OpenTextFile(strLogFileAndPath, 8, True)
'Create Logging File if it does not exist
Dim strListLog
Dim oListLog
strList = "List.log"
strListFileAndPath = strLoggingPath & strList
If (oFileSystem.FileExists(strListFileAndPath)) Then
oFileSystem.DeleteFile(strListFileAndPath)
End If
Set oListLog = oFileSystem.OpenTextFile(strListFileAndPath, 8, True)
Set oWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strPCName & "\root\cimv2")
Set colQuickFixes = oWMIService.ExecQuery("Select * from Win32_QuickFixEngineering")
iUpdateCount = 0
For Each oItem in colQuickFixes
strHotfixID = oItem.HotFixID
If (strHotfixID <> "File 1") Then
If (strLastHotfixID <> strHotfixID) Then
strLastHotfixID = strHotfixID
iUpdateCount = iUpdateCount + 1
End If
oListLog.WriteLine oItem.HotFixID
End If
Next
oRunLog.WriteLine "Update Count: " & iUpdateCount
oRunLog.Close