2008-09-10
| Table of Contents: |
| Rate This Article: | Add This Article To: |
( Page 1 of 5 )
Need a huge database that contains special details of your server? You may already have one and not know it.
Imagine you have a huge database at your disposal that tells you just about everything you can imagine about a system and probably a wealth of things you didn’t even know existed. Using that database could save you significant time and effort trying to find the information in other ways. Now, imagine you have to use a rinky-dink utility to access this huge database—a utility that only a few can begin to understand and no one can master. It’s frustrating to think about, isn’t it? Well, now you know the plight of Windows Management Instrumentation (WMI) users everywhere. WMI is a huge database that contains significant information about your system, but it’s incredibly hard to use. Fortunately, Visual Studio can make things significantly easier. In fact, using Visual Studio to access WMI makes things mind-numbingly simple.
Seeing WMI through WMIC
The terrifyingly complex application that most administrators use to access WMI is the Windows Management Instrumentation Command line (WMIC) utility. To get some idea of just how complex this utility is, open a command prompt and type WMIC /?. The basic help goes on for pages—really.
After you figure out which of the aliases you want to use (a common name for a WMI class), you can begin working with WMIC. Let’s say you want to determine whether the computer system supports a boot ROM. In this case, you type WMIC ComputerSystem GET BootRomSupported and press Enter. Sounds simple enough, but you had to know which alias, verb, and property to use. Fortunately, you can use help to drill down to what you need. For example, typing WMIC ComputerSystem /? and pressing Enter tells you which verbs you can use with the ComputerSystem alias.
Now, let’s say you’re working on Windows Server 2008 Server Core and can’t access My Computer. You have to rely on WMI to change the computer name from the gobbledygook that Microsoft provides into something you can actually use for accessing the server. Renaming the computer is harder than you might think. You have to type WMIC ComputerSystem Where Name=”%COMPUTERNAME%” Call Rename Name=”NewName” where NewName is the new name of the computer. Try remembering that command. Just in case you’re interested, you can find a WMI reference at http://msdn.microsoft.com/en-us/library/aa394572(VS.85).aspx that lists some, but not all, of the WMI classes.
As you ask WMIC to do more, the commands also become more complex. First of all, I’ve never found a complete listing of all of the WMI classes anywhere and the aliases only expose the most common classes. It finally gets to the point where you have to experiment and rely heavily on help to accomplish the smallest task. I’m not saying that WMIC doesn’t work—after all, I’ve used it extensively to configure my Server Core setup—I’m just saying that there has to be an easier way to work with this huge, but valuable, database.
![]() |
|


