Windows Patches needed

Recommended Posts

  • LogicMonitor Staff


See details on my blog .  A DataSource that shows which Windows patches are needed. The patch names, and KB numbers show as instances and are grouped by Microsoft's 'classifications'. A special instance named 'summary' shows how many days since the last patch was installed and how many patches are needed.


Link to post
Share on other sites
  • 2 weeks later...

Hi @Mike Suding

I have found that sometimes it is possible to get a false $DayDiff when going by the most recently installed update. I found an example on a server where an older roll-up was installed recently and the returned date was way in the past. So, I'm using the following method, which so far has been returning the expected results:

    $LAST_UPDATE_KEY_PATH = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Detect"

    If (Test-Path -Path $LAST_UPDATE_KEY_PATH)
      $lastSuccessTime = [datetime](Get-ItemProperty -Path $LAST_UPDATE_KEY_PATH -name "LastSuccessTime").LastSuccessTime
      $DayDiff = $(New-TimeSpan -start $lastSuccessTime).Days
      $DayDiff = -1
Edited by Mosh
Link to post
Share on other sites
  • 1 year later...
  • Administrators

The KB# appears to be the first part of the instance name. I haven't looked at the code, but you could likely modify it to store the KB# as an instance level property.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.