Subscribe

SQLServer-DBA.com Links

Subscribe to newsletter

Dba_db2_button

Powered by TypePad
Powershell List all Patches Updates on a Server

23 June,2012 by Jack Vamvas

I was troubleshooting a SQL Server problem . I was stuck , as I couldn’t  remember making any changes. I started investigating any patch updates on the server.  Powershell and the Microsoft.Update.Session object do a go job on returning the patch list.

From discovering the latest patches updated , I was able to investigate what changes occurred.

This script lists all the patches/updates installed on the server

$MicrosoftUpdateSession = New-Object -ComObject Microsoft.Update.Session 
$SearchResult = $null
$UpdateSearcher = $MicrosoftUpdateSession.CreateUpdateSearcher()
$UpdateSearcher.Online = $true
$SearchResult = $UpdateSearcher.Search("IsInstalled=1 and Type='Software'") 

$x = 1
foreach($Update in $SearchResult.Updates)
{
	Write-Host "$x : $($Update.Title + " - " + $Update.SecurityBulletinIDs)"
	$x += 1
}

Author: Jack Vamvas (http://www.sqlserver-dba.com)

******** *******

Subscribe to SQLServer-DBA.com

Latest posts delivered to you daily

Delivered by FeedBurner

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment


sqlserver-dba.com | SQL Server Performance Tuning | SQL Server DBA:Everything | FAQ | Contact|Copyright & Disclaimer