References, Scripting, Windows
comments 2

WMIC – Windows Management Instrumentation Command-line

WMIC is a great tool to retrieve lot of useful system information without even writing a single line of code. I have used this for a while and find it really useful when scripting some repeated tasks such as enabling remote desktop on a group of systems, adding systems to Windows domain, etc, etc. It also provides a way to learn about Windows Management Instrumentation.
WMIC Help

For example, if you bring up help for WMIC at the command prompt, it shows various aliases available for management.

Alias

Alias

Each alias is associated with a WMI class. You can find an association by using alias command at WMIC prompt.

ComputerSystem

ComputerSystem

<Alias> /?, for example COMPUTERSYSTEM /? will provide help on how that object can be used to get/set information. Similarly, you can use the help option to see understand each option available. This is a standard set of options for all objects within WMIC. CALL option within this list if something interesting. If you check for help on this, you will actually see a list of all methods available under this WMI class.

Classes

Classes

This provides a great way to learn about WMI classes and method. You can also correlate this to Win32_ComputerSystem documentation available on MSDN website.

Filed under: References, Scripting, Windows

by

Ravikanth is a principal engineer and the lead architect for Microsoft and VMware virtualized and hybrid cloud solutions within the Infrastructure Solutions Group at Dell EMC. He is a multi-year recipient of Microsoft Most Valuable Professional (MVP) award in Windows PowerShell (CDM) and Microsoft Azure. Ravikanth is the author of Windows PowerShell Desired State Configuration Revealed (Apress) and leads Bangalore PowerShell and Bangalore IT Pro user groups. He can be seen speaking regularly at local user group events and conferences in India and abroad.