WMI on Linux

WMI is a great way to query Windows systems without being so intrusive. As of late, I have been dealing with it more and more. Typically, I use a Windows system to query another Windows system but the lack of speed inherit to the Windows OS always has me searching for better ways to complete simple tasks. I quickly turned to Linux as its speed one of many great features of the OS. Using WMI within Linux is achievable although many may not know it. Getting started is pretty simple, to do so check out the below.

1. Install the repo (CentOS 6 or newer).
[nando@localhost home]$ rpm -Uvh http://www6.atomicorp.com/channels/atomic/centos/6/x86_64/RPMS/atomic-release-1.0-19.el6.art.noarch.rpm

2. Install WMIC from the repository.
[nando@localhost home]$ yum –y install wmi

Some common queries and what the grab are below.
wmic -U admin%admin1234 // “SELECT CommandLine,Name,ProcessId FROM Win32_Process”

wmic -U admin%admin1234 // “SELECT * FROM Win32_ComputerSystem”