Windows IT Pro is the authoritative and independent resource for windows nt, windows 2000, windows 2003, windows xp. Features a collection of resources and magazines for windows IT professionals.
  
  
  Advanced Search 


February 2008

Get Hotfix Information Quickly with WMIC

RSS
Subscribe to Windows IT Pro | See More Hotfixes Articles Here | Reprints | Or get the Monthly Online Pass—only $5.95 a month!

Download the Code Here

Executive Summary:
Microsoft Windows Management Instrumentation (WMI) offers numerous classes and properties that you can use to retrieve information about local and remote computers. The Windows Management Instrumentation Command-line (WMIC) utility brings that functionality to the command line. This article explores how you can use the Windows Management Instrumentation Command-line utility to retrieve the IDs of all the hotfixes installed on the local machine.


There are dozens of different ways to find the hotfixes installed on computers, but the fastest and simplest way is to use a widely available tool named Windows Management Instrumentation Command-line (WMIC). With WMIC, getting the IDs of all the hotfixes installed on the local system can be done with this short command

wmic qfe get Hotfixid

If you aren’t familiar with WMIC and want an even shorter command to remember, you can cut the command down to

wmic qfe

Besides displaying the IDs, this command displays other details (e.g., hotfix name, hotfix installation date) about the installed hotfixes, which can be helpful.

If you just need to determine whether a specific hotfix is installed, you can avoid searching through a long list of hotfixes by piping the wmic qfe command’s output through the Find command. For example, if you want to see whether hotfix 938194 is installed on the local machine, you can run the command

wmic qfe | find “938194”

Note that you need to enclose the search string (in this case, 938194) in quotes.

At this point, you might be wondering what qfe is. In WMIC, you use aliases such as qfe to specify the Windows Management Instrumentation (WMI) class you’re interested in retrieving information from. In WMIC, an alias is essentially a nickname. Just like it’s easier to remember people’s nicknames than their full names, it’s easier to remember classes’ aliases than their full names. Besides helping with familiarity, aliases reduce what you have to type on the command line and can help differentiate between classes with similar names.

Although WMIC assumes that you’re using aliases on the command line, you can use standard Windows Management Instrumentation (WMI) class paths instead. For example, qfe is the alias for WMI’s Win32_Quick- FixEngineering class, therefore

wmic qfe get Hotfixid

is equivalent to

wmic path win32_quickfixengineering get Hotfixid

The path keyword that precedes the name of the WMI class tells WMIC that the path to a WMI class follows. So, if you don’t know a particular WMIC alias for a WMI class, all you need to do is use the path keyword followed by the class’s name.

There are several reasons why I use WMIC for checking hotfixes. As I mentioned earlier, it’s fast. You can type the entire command in an open command-prompt window more quickly than you can navigate to most programs on the Windows Start menu. It’s simple because you don’t need to install special programs to perform the query for you. Equally important, you can use it with virtually any Windows OS. Although WMIC has been around only since Windows XP, you can use WMIC’s /node parameter to run the utility remotely against earlier Windows OSs, as long as those OSs are running WMI. For example, to check for hotfixes on a Windows NT 4.0 system named LegacyHost that has the NT 4.0 WMI extensions installed, you’d run the command

wmic /node:legacyhost qfe get Hotfixid

There’s another reason to use WMIC for getting hotfix information. If you don’t already use WMIC, it gives you an opportunity to become familiar it, which has an immense long-term payoff: One tool is all you’ll need to find out information about any WMI property on any system you’re connected to. All you need to know is the property’s name and the appropriate alias. For example, if you want the names of all the printers on the local system, you’d use the printer alias with the Name property in the command

wmic printer get Name

Need the CPU speed on the local machine? Simply run

wmic cpu get CurrentClockSpeed

The built-in aliases that are available for use can differ depending on the OS you’re using. For example, if you need to find the memory currently installed on a Windows XP computer, you’d need to use

wmic memlogical get totalphysicalmemory

But on a Windows Server 2008, Windows Vista, or Windows Server 2003 machine, the command would be

wmic memorychip get Capacity

On the Windows IT Pro Web site, you can download a Microsoft Excel spreadsheet that shows the differences between WMIC aliases on various OS versions. Go to www.windowsitpro.com/Windows/Article/ArticleID/97781/97781.html and click the Download the Code Here button near the top of the page. The 97781.zip file that you download will contain the spreadsheet.

For more detailed information about WMIC’s options, you can check the built-in Help feature with one of the following commands:

wmic /?
wmic /?:full

Spending a little time learning about these options will pay off later when you need quick access to particular information about the systems you support.

End of Article



Reader Comments

You must log on before posting a comment.

If you don't have a username & password, please register now.




Top Viewed ArticlesView all articles
Friday at PASS Europe 2006

Kevin talks about the closing day of the event and shares a funny Microsoft film. ...

Escape From Yesterworld

Kevin points you to the funniest SQL Server website ever! ...

The Desktop tab is missing from the Display Properties in Windows XP?

...


Related Articles Rem: Disabling System Restore

Rem: Retrieving a Computer’s Manufacturing Information

What is the Windows Management Instrumentation Command-line (WMIC)?

WMIC

Windows OSs Whitepapers Replay for Exchange: Enterprise Protection and an Affordable Price

Are You Satisfied?

A Preliminary Look at Deployment Plans for Microsoft Windows Vista

Related Events Check out our list of Free Email Newsletters!

Windows OSs eBooks Understanding and Leveraging Code Signing Technologies

A Guide to Windows Certification and Public Keys

SQL Server Administration for Oracle DBAs

Related Windows OSs Resources Become a VIP member of the Windows IT Pro community!
Get it all with the VIP CD and VIP access. A $500+ value for only $279!

Subscribe to Windows IT Pro!
Solve your toughest technical problems with our experts and access 10,000 + articles online. 30% off

Monthly Online Pass - Only $5.95!
Get instant access to 10,000+ articles from Windows IT Pro Magazine!

TechNet Virtual Labs
Evaluate and test Microsoft's newest products.

Job Openings in IT


ADS BY GOOGLE SPONSORED LINKS FEATURED LINKS

WinConnections Conference Fall 2008
Don’t miss the premier event for Microsoft IT Professionals in Las Vegas, November 10-13. Register and book your room by August 25 and receive a FREE room night (based on a three night minimum stay).

Maximize your SharePoint Investment – 8 Cities
Discover best practices and tips for both architecting and administering SharePoint. Early Bird Price of $99 through Sept 15th.

Find a new job now on the all new IT Job Hound!
Search jobs, post your resume, and set up job e-mail alerts!

Master SharePoint with 3 eLearning Seminars
Learn how to build a better SharePoint infrastructure and enable powerful collaboration with MVPs Dan Holme and Michael Noel. Register today!

Top Tools for Virtualization Disaster Recovery & Replication
View this web seminar on August 14th to learn about two tools that will result in faster backup and restore with P2V disaster recovery.

SharePointConnections Conference Fall 2008
Don’t miss the premier event for Microsoft IT Professionals in Las Vegas, November 10-13. Register and book your room by August 25 and receive a FREE room night (based on a three night minimum stay).

VMworld 2008 - Sign Up Today!
Join your peers on September 15-18 at The Venetian Hotel in Las Vegas as VMware hosts VMworld 2008, the leading Virtualization event.



When managing just VMware isn’t enough
Plan/Manage/Secure – NetIQ VMware management. Download whitepaper.

What’s up with your network? Find out with ipMonitor
Availability monitoring for servers, applications and networks – FREE trial

Microsoft® Tech•Ed EMEA 2008 IT Professionals
Advance your thinking with new ideas and practical real-world solutions at Microsoft’s FIVE day technical infrastructure conference 3-7 Nov., 2008. Register before 26 September 2008 to save €300.

Order Your Fundamentals CD Today!
Gain an introduction to Exchange, learn server security requirements, and understand how unified communications can play a role in your messaging strategies with this free Exchange CD.

Are You Really Compliant with Software Regulations?
View this web seminar that will help you with compliance best practices and check out a management solution to assure that you won’t be in jeopardy of an audit.

Virtualization Congress Oct. 14-16 in London
Don't miss Virtualization Congress, the premiere EMEA conference dedicated to hardware, OS and application virtualization. Oct. 14-16 in London.
Windows IT Pro Home Register FAQ for Windows WinInfo News
Europe Edition About Us Contact Us/Customer Service Media Kit Affiliates / Licensing  
SQL Server Magazine Office & SharePoint Pro Windows Dev Pro IT Job Hound ITTV
IT Library Technical Resources Directory Connected Home Windows Excavator Windows SuperSite 
 
 Windows IT Pro is a Division of Penton Media Inc.
 Copyright © 2008 Penton Media, Inc., All rights reserved. Terms and Use | Privacy Statement | Reprints and Licensing