Get all hotfixes installed by date in Powershell

Powershell offers multiple cmdlets and methods to fetch information about the hotfixes installed by date. We will look at three ways by which you can get all the hotfixes that are installed on a Windows computer. The output is sorted by the installed date.

Getting hotfix history could be a crucial requirement of the internal or external auditors of the business. For an Information System, hotfix history is a critical component of security audits and hardening processes.

We look at three ways by which we can find all the hotfixes that are installed on a Windows computer.

  • Get-Hotfix to get all hotfixes installed and sorted by date
  • CIM Instance method to get hotfix history using Win32_QuickFixEngineering
  • WMI Object method to get hotfix history using Win32_QuickFixEngineering class

Get-Hotfix to find all hotfixes sorted by date

Get-Hotfix remains the simplest and quickest way to find the hotfix history on a Windows computer. Get-Hotfix cmdlet’s output is piped to the sort-object directive. This is done to sort the output based on the date of installation of the hotfix.

The exact command that you can use in Powershell to get hotfix history is shared below. You can use it for the desired action.

Get-Hotfix | Sort-Object -Descending -Property InstalledOn -ErrorAction SilentlyContinue

The Error action directive has been added to bypass any command errors and generate the output on the console.

The output of this command is represented below in the screenshot.

Get Hotfix installed by date using CIM Instance

You can also find the hotfixes installed by date on a Windows computer using the CIM Instance method in Powershell. The CIM Instance method will use Win32_QuickFixEngineering class to get the hotfix history for a computer.

The exact command that can be used to query the Win32_Quickfixengineering class is given below:

Get-CimInstance Win32_QuickFixEngineering | sort-object InstalledOn

The output of this command is shared below in the screenshot image.

Get Hotfix history using WMI Object

WMI Object method can be used to bring out the hotfix history on a Windows computer. Like CIM Instance, the WMI Object method will also make use of the Win32_QuickFixEngineering class to achieve the desired objective.

The exact command that makes use of the WMI Object method in Powershell is given below.

Get-WMIObject Win32_QuickFixEngineering | sort-object InstalledOn

The output of this command is shared below in the screenshot. The output is similar to the output generated by the CIM Instance method of querying the Win32_QuickFixEngineering class.

The output of all these three commands is similar. You could use either of these commands or methods to get the hotfix history on a Windows computer.

Rajesh Dhawan

Rajesh Dhawan is a technology professional who loves to write about Cyber-security events and stories, Cloud computing and Microsoft technologies. He loves to break complex problems into manageable chunks of meaningful information.