Powershell can be used to find the update history of a Windows computer. You can fetch details of cumulative or security updates installed on a Windows computer using multiple Powershell commands. We look at simple ways by which you can fetch security update information from a Windows computer.
Using wmic in Powershell to find Windows Update history
The wmic command can be used in Powershell to fetch update history on a Windows computer. For this, you will need to get into the Powershell session and use the following command:
wmic qfe list /format: table
This command will fetch the latest security updates and cumulative updates installed on the computer. It will then display the output as a formatted table. You will need to have administrative privileges to run the Powershell command. The output of this command looks like the screenshot below. You can see that the command output lists the security update identifier and its corresponding page on the Microsoft website for a full reference of the cumulative update and security update for the Windows version on the computer.
For its simplicity, the wmic command remains one of the simplest and most often used commands in Powershell. And, we believe that using the wmic command gets you the relevant updates for Windows computers in a quick and concise way.
However, we are also listing the additional methods of getting security update history using the WMI Object and CIM Instance methods as well. These methods also compile and share the update history for a Windows computer.
Use WMI Object to get Windows Update history in Powershell
WMI Object can be used to get information about the latest updates installed on a Windows computer. You can run this command on a local computer to connect to a remote computer and find the update history.
WMI Object will work on the Quickfixengineering class to organize the update information for you. Below is the command that can be used to get the Windows update history using WMI Object:
get-wmiobject win32_quickfixengineering |sort installedon -desc
The output of this command looks like the screenshot below. The update history is sorted based on the installed on date of each security update.
You can see that the latest Hotfixes that have been installed on the Windows computer have been shared with the HotfixID as well. This information becomes extremely useful for system administrators to create the update schedules for the next update cycle for any Windows computer.
Using CIM Instance to get Windows update history
The CIM Instance method can also be used to get the cumulative update history for a Windows computer, including the hotfixes installed. CIM Instance will also work on the Quickfixengineering class to organize this information. You can use the following command to get the system update history details:
Get-CIMInstance win32_quickfixengineering |sort installedon -desc
The output of this command is pasted below for your ready reference as a screenshot:
The output of this command is similar to the output of the WMI Object method.
In this Powershell tutorial, we have discussed three methods to get the latest Windows updates installed on the computer. These commands can be used on a Windows computer locally. If Powershell remoting is enabled, you can run the Powershell cmdlets remotely as well. Alternatively, you can connect to the remote computer using PSExec and run these commands locally on the system.
Rajesh Dhawan is a technology professional who loves to blog about smart wearables, Cloud computing and Microsoft technologies. He loves to break complex problems into manageable chunks of meaningful information.