WMI – Client – Installation on Linux/CentOS

Background

Recently I was playing around with WMI on an MS Windows machine.

I wanted to try the same sample queries from a Linux machine.

 

Installation

Outline

  1. RPM
    • Identify RPM Source
    • Download RPM
    • Install RPM
  2. Validate
    • wmic

RPM

Identify RPM Source

Here are some sources that avail WMI Clients for Linux:-

Organization CentOS Version RPM Name Date Released RPM Link
Atomicorp
centOS v7 wmi-1.3.14-4.el7.art.src.rpm 2014-July-7th Link
centOS v6 wmi-1.3.14-4.el6.art.x86_64.rpm 2013-August-3rd Link
centOS v6 wmi-1.3.14-3.el6.art.x86_64.rpm 2013-April-13th Link

 

Download RPM Artifact

Code

Syntax

wget [url]

Sample

wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm

Output
Output – Image

Output – Text

>wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm
--2021-06-18 21:27:22--  http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm
Resolving www6.atomicorp.com (www6.atomicorp.com)... 51.161.13.101, 51.79.80.20
Connecting to www6.atomicorp.com (www6.atomicorp.com)|51.161.13.101|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 8075232 (7.7M) [application/x-rpm]
Saving to: ‘wmi-1.3.14-4.el7.art.x86_64.rpm’

wmi-1.3.14-4.el7.art.x86_64.rpm         100%[============================================================================>]   7.70M  2.20MB/s    in 3.7s

2021-06-18 21:27:26 (2.08 MB/s) - ‘wmi-1.3.14-4.el7.art.x86_64.rpm’ saved [8075232/8075232]



Install RPM Artifact

Code

Syntax

wget [url]

Sample

wget http://www6.atomicorp.com/channels/atomic/centos/7/x86_64/RPMS/wmi-1.3.14-4.el7.art.x86_64.rpm

Output
Output – Image

Output – Text

>sudo yum install -y ./wmi-1.3.14-4.el7.art.x86_64.rpm
Repository packages-microsoft-com-prod is listed more than once in the configuration
Last metadata expiration check: 7:59:36 ago on Fri 18 Jun 2021 09:20:39 AM PDT.
Dependencies resolved.
=============================================================================================================================================================
 Package                        Architecture                      Version                                      Repository                               Size
=============================================================================================================================================================
Installing:
 wmi                            x86_64                            1.3.14-4.el7.art                             @commandline                            7.7 M

Transaction Summary
=============================================================================================================================================================
Install  1 Package

Total size: 7.7 M
Installed size: 36 M
Is this ok [y/N]: y
Downloading Packages:
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                     1/1
  Installing       : wmi-1.3.14-4.el7.art.x86_64                                                                                                         1/1
  Running scriptlet: wmi-1.3.14-4.el7.art.x86_64                                                                                                         1/1
  Verifying        : wmi-1.3.14-4.el7.art.x86_64                                                                                                         1/1
Installed products updated.

Installed:
  wmi-1.3.14-4.el7.art.x86_64

Complete!



 

Validate

wmic

code

Syntax

wmic -U [domain/]adminuser%password //<host> <query>
Sample

wmic -U [lab/]administrator%pass1819 //labSQL "select * from Win32_ComputerSystem"

Output

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s