Basic Uses of the WMI (Windows Management Instrumentation) Command Line for Administration
By Michael Sinno, published Apr 05, 2007
Published Content: 4 Total Views: 1,704 Favorited By: 0 CPs
Embed:
WMI stands for Windows Management Instrumentation. It is most frequently used for management and monitoring of Servers and Workstations through scripts. However, for you non scripter's out there (you know you are) can still leverage the power of WMI. While not as powerful as a fully scripted WMI solution it still provides mountains of useful features that you can leverage right now. Better yet, I have found that it functions as a great gateway drug to help people realize the power of scripting. This overview barely scratches the surface as to what is available, but it provides the basic knowledge needed to start playing with the command line.Right now you're probably thinking. How do I get it? Well, the odds are you already have it and just need to use it. Microsoft included it with the following operating systems:
Windows XP
Windows Server 2003
Windows Vista
In order to access it you simply need to drop into a command prompt and type in "wmic". It will most likely give you a message asking you to wait while the WMIC installed. Once this is complete you will be greeted with the following prompt:
wmic:root\cli>
So now what? In order to get started just type in /? to get a listing of the global switches and aliases. The global switches specify how and where a particular WMI query should be run and the aliases specify the actual information. For example, let's say you want to find out information relating to the operating system. At the wmic prompt type in:
os
This outputs relevant data that is located in the os alias. There is a problem though. The data is output in a very unfriendly format that requires you to scroll instead of down. It's actually quite a pain!
There are several solutions to this and they can all be found by using /?. Now, type in:
os /?
You will see a listing of the global verbs. Just as we learned in English class these are the action words. They help you to do something with the data. There is a "list" verb that will let you determine how you want the data listed. Within the list verb there are several options for how the output can be displayed. These can be accessed by typing in the following:
os list /?
More by Michael Sinno
- Listing and Killing Processes from the Windows Command Line: Stupid Admin Tricks #2
- Basic Uses of the WMI (Windows Management Instrumentation) Command Line for Administration
- Ten Useful Windows Native Command Line Utilities
- Google Apps for Your Domain in Small Companies
You may also like...
- How to Access the Command Prompt in Windows XP
- Open a Command Prompt Window in Under 2 Seconds
- Using the "TRACERT" Command to Trace a Route on a Mac, Windows, or Linux Computer
- Electronic Arts Announces Command & Conquer 3: Tiberium Wars
- Online Video Claims Rudy Giuliani Lied About Command Center at WTC
- Command and Conquer 3 Tiberium Wars
- How To Use the Run Command In Microsoft Windows
- Walter Reed General Relieved of Command
- Product Review: 3m Command Hook
- How to Use the IPCONFIG /ALL Command
Takeaways
- Using WMI for Data Collection
- Using WMI to enable Remote Desktop Services
Comments
Type in Your Comments Below - (1000 characters left)
Most Commented On

