Microsoft tool exposes WMI namespaces and properties

Windows Management Instrumentation (WMI) is mainly a programmer's tool that provides programmatic ways to manage a system or get information about the manageable objects in a system. Now, not everyone's a programmer, nor does everyone want to be. However, nearly every administrator is going to have someexposure to programming, even if it's just to use pre-generated code samples.

One utility for generating code that can be used to work with WMI objects is a

    Requires Free Membership to View

free tool from Microsoft, called the WMI Code Creator. This is by far the most comprehensive tool I've found for this kind of work, and it's designed to make working with WMI namespaces as effortless as possible.

The program is a self-contained executable; no installation is needed. When you run it, it presents you with four tabs:

  • Query for Data from a WMI Class;
  • Execute a Method;
  • Receive an Event; and
  • Browse the Namespaces on this Computer.

In each tab there's a dropdown that presents a list of all available namespaces and classes for that namespace; there are also drop-downs or selectors for other entities available with each type of item.

For instance, the Method tab contains a list of methods, as well as parameters. If you're querying for data from a WMI class, you can select the properties, then search for any values available for that property. The Receive an Event tab even has a hotlink directly to the online MSDN library that lets you look up the documentation available for the selected event class.

Once you've selected all the details of the WMI class, the code generated to use that class appears in a right-hand pane. If you want to change the language of the code, select one from the Code Language menu; the program supports C#, VB.NET and classic VBScript. The resulting code can also be automatically opened in Notepad or sent directly to a command line to be executed. Finally, the WMI classes don't have to be pulled exclusively from the current computer; any computer that's accessible via RPC can be polled for WMI objects.

Serdar Yegulalp is editor of the Windows Power Users Newsletter. Check it out for the latest advice and musings on the world of Windows network administrators. He is also author of the book Windows Server Undocumented Solutions.

More information from SearchWinSystems.com


This was first published in May 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

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

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.