Powershell – Get the actual installed dates of hotfixes

The Get-Hotfix cmdlet has a bug in it that does not always return the installed date for patches, yet in control panel /Windows update the history will show the actual install date.

this little script “fixes” that

 

NOTE: WinRM is required to be running and ports open or the remote devices firewall

 

 

 

5 thoughts on “Powershell – Get the actual installed dates of hotfixes

  1. Great script.

    You just need one minor amendment to get $Computername to output. Because it’s inside the Scriptblock, it’s out of scope on the remote computer, therefore you need to change it to $Using:Computername – then it’ll work a treat.

    • Hi!

      I have updates the script so it can pass computernames.
      e.g. save my script as c:\temp\test.ps1
      Create a text file with a list of all computers you want to check
      .e.g. c:\temp\test.txt

      run this code

      $ListOfComputers = Get-Content -path C:\temp\test.txt

      foreach ($item in $ListOfComputers)
      {
      c:\temp\test.ps1 -computername $item
      }
      I will step through the list in the text file and give you the results

  2. Depending on how the hotfixes were installed, this script may return incorrect InstalledOn dates (or miss them altogether). The script will show the dates that are displayed the Control Panel > System and Security > Windows Update > View update history. The same KB install dates in Control Panel > Programs > Programs and Features > Installed Updates can be completely different.

    For example: One of our servers has KB4012215 with an ‘Installed On’ value of 28/02/2019 (Installed Updates) but the same KB has a ‘Date Installed’ value of 07/01/2019 (View update history).

    How hard is it for Microsoft to have one place for all Windows Updates metadata regardless of whether the installed method is via interactive, SCCM, script, …, whatever that can be queried and reported on.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.