Link to home
Start Free TrialLog in
Avatar of Bobby Batts
Bobby BattsFlag for United States of America

asked on

How to Determine Windows' Update Levels Using PowerShell

I need to determine the patch level for each server on my domain. If anyone has a PowerShell script would work to solve this problem, I would appreciate it.  I would like to query the registry, and the Windows directory for any files that indicate the latest patch version.  

Thank you,

Lipotech
Avatar of NinjaStyle82
NinjaStyle82
Flag of United States of America image

Lipotech,

How do you intend for this to work? there is not patch level number for all of Microsoft update, you could however query for individual patches... unless you are just looking for the version of windows...
Avatar of Kanti Prasad
Kanti Prasad

Hi

You can use

Get-WmiObject -Class "win32_quickfixengineering" |
Select-Object -Property "Description", "HotfixID",
@{Name="InstalledOn"; Expression={([DateTime]($_.InstalledOn)).ToLocalTime()}}

There are other option in the below link
http://social.technet.microsoft.com/wiki/contents/articles/4197.how-to-list-all-of-the-windows-and-software-updates-applied-to-a-computer.aspx
Avatar of Sudeep Sharma
I think the closest you could get is Using the Powershell module for Windows Update.

You can use Get-WUHistory to get the history of updates installed on a system, then you can parse the output to get the date and KBArticle from the outout.

Windows Update PowerShell Module:
https://gallery.technet.microsoft.com/scriptcenter/2d191bcd-3308-4edd-9de2-88dff796b0bc

Sudeep
Avatar of Bobby Batts

ASKER

Kanti,

The script you suggested successfully executed.  How can I modify this script to execute across the entire domain on specific servers. I have a text file with a list of servers. I suspect I will need to index this file for all servers within the file and then query the domain for servers within the file and report security updates.  How can I modify the script to accomplish that object.

-------
Get-WmiObject -Class "win32_quickfixengineering" |
 Select-Object -Property "Description", "HotfixID",
 @{Name="InstalledOn"; Expression={([DateTime]($_.InstalledOn)).ToLocalTime()}}


Thank you,

Lipotech
ASKER CERTIFIED SOLUTION
Avatar of Kanti Prasad
Kanti Prasad

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.  Thank you.  Great response.