Today with PowerShell – Sunday 15th March, 2015

Today I used PowerShell to list failed Windows Updates Sad smile


$session = New-Object -ComObject Microsoft.Update.Session
$us = $session.CreateUpdateSearcher()
$qtd = $us.GetTotalHistoryCount()
$hot = $us.QueryHistory(0, $qtd)
$hot| Select-Object *  | Where { $_.ResultCode -eq 4 }| ft Title, ResultCode, Date –AutoSize

Advertisements
This entry was posted in PowerShell. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s