PowerShell for Windows Admins

Dec 29 2009   12:21PM GMT


Richard Siddaway Richard Siddaway Profile: Richard Siddaway


We have seen how to get information on the Operating System installed on our computers. We can round that out by looking at the hotfixes that are installed on the machine.

Get-WmiObject -Class Win32_QuickFixEngineering

Source        Description      HotFixID      InstalledBy          InstalledOn
——        ———–      ——–      ———–          ———–
RSLAPTOP01    Update           KB972636      RSLAPTOP01\Richard   08/07/2009 00:00:00
RSLAPTOP01    Security Update  KB973525      NT AUTHORITY\SYSTEM
RSLAPTOP01    Update           KB973874      NT AUTHORITY\SYSTEM
RSLAPTOP01    Update           KB974332      RSLAPTOP01\Richard
RSLAPTOP01    Update           KB974431      NT AUTHORITY\SYSTEM
RSLAPTOP01    Security Update  KB974455      NT AUTHORITY\SYSTEM
RSLAPTOP01    Security Update  KB974571      NT AUTHORITY\SYSTEM
RSLAPTOP01    Update           KB975364      RSLAPTOP01\Richard   11/01/2009 00:00:00
RSLAPTOP01    Hotfix           KB975467      NT AUTHORITY\SYSTEM
RSLAPTOP01    Update           KB976098      NT AUTHORITY\SYSTEM
RSLAPTOP01    Security Update  KB976325      NT AUTHORITY\SYSTEM  12/11/2009 00:00:00
RSLAPTOP01    Update           KB976749      RSLAPTOP01\Richard   11/04/2009 00:00:00

This displays all hotfixes. Sometimes we may just want to test for a single fix

Get-WmiObject -Class Win32_QuickFixEngineering -Filter “HotFixID=’KB972636′”

of for a set of machines

“RSLAPTOP01”, “” | foreach {
if (Get-WmiObject -Class Win32_QuickFixEngineering -Filter “HotFixID=’KB972636′”)
{Write-Host “$($_) has KB972636 installed”}

With PowerShell v2 If we want to learn more about a particular fix we can do this

Get-WmiObject -Class Win32_QuickFixEngineering -Filter “HotFixID=’KB972636′” | foreach {Start-Process $_.caption}

The caption property conatins  a URL e.g. http://support.microsoft.com/?kbid=972636

A get-hotfix cmdlet has been introduced that simplifies this

Get-HotFix -Id KB972636 | foreach {Start-Process $_.Caption}

We have finished our look at the OS – next time we will start looking at disks.

Happy New Year

Technorati Tags: ,,

 Comment on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: