Category filter
PowerShell script to Get HotFix info on Windows devices
This document helps you retrieve information about hotfixes installed on a Windows system using scripts.
Hotfixes are important updates issued by Microsoft to address security vulnerabilities, bug fixes, performance enhancements, or feature improvements. These updates are crucial to keeping systems secure, stable, and optimized. But how do we determine which hotfixes are installed on managed devices?
Get-HotFix is a PowerShell command that retrieves information about the hotfixes (updates or patches) installed on a Windows system. Executing the Get-HotFix command on devices provides a simple and efficient way to gather detailed information about the hotfixes applied to a system, making it essential for troubleshooting, auditing, and inventory management. Using Hexnode’s Execute Custom Script remote action, administrators can execute this PowerShell command on a remote Windows device.
PowerShell script
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
Param( [string]$HotFixID, [string]$Description, [datetime]$StartDate ) $hotfixes = Get-Hotfix if($HotFixID){ $hotfixes = $hotfixes | Where-Object {$_.HotFixID -like "*$HotFixID*"} } if($Description){ $hotfixes = $hotfixes | Where-Object{$_.Description -like "*Description*"} } if($StartDate){ $hotfixes = $hotfixes | Where-Object{$_.InstalledOn -ge $StartDate} } $hotfixes | Format-Table -Property Description, HotFixID, InstalledOn |
This PowerShell script allows admins to retrieve a list of installed hotfixes on a system. The Get-Hotfix command uses the following parameters here in this script:
- HotFixID
- Description
- StartDate
You can follow the steps to access the output of the script.
- Login to your Hexnode UEM portal.
- Navigate to the Manage tab.
- Select the device on which the script was executed.
- Go to Action History.
- You can find the option Output corresponding to the policy applied.