WMI – Client – Usage on Linux/CentOS

Background

Let us quickly try out some of the options for using wmic application on a Linux host.

 

Usage

Outline

  1. Options
    • Review

Options

Text


>wmic
Usage: [-?|--help] [--usage] [-d|--debuglevel DEBUGLEVEL] [--debug-stderr]
        [-s|--configfile CONFIGFILE] [--option=name=value]
        [-l|--log-basename LOGFILEBASE] [--leak-report] [--leak-report-full]
        [-R|--name-resolve NAME-RESOLVE-ORDER]
        [-O|--socket-options SOCKETOPTIONS] [-n|--netbiosname NETBIOSNAME]
        [-W|--workgroup WORKGROUP] [--realm=REALM] [-i|--scope SCOPE]
        [-m|--maxprotocol MAXPROTOCOL] [-U|--user [DOMAIN]USERNAME[%PASSWORD]]
        [-N|--no-pass] [--password=STRING] [-A|--authentication-file FILE]
        [-S|--signing on|off|required] [-P|--machine-pass]
        [--simple-bind-dn=STRING] [-k|--kerberos STRING]
        [--use-security-mechanisms=STRING] [-V|--version] [--namespace=STRING]
        [--delimiter=STRING]
        //host query

Example: wmic -U [domain/]adminuser%password //host "select * from Win32_ComputerSystem"
>

 

Options

Here are some of the options:-

Option Short Name Option Long Name Meaning Explanation Sample
-d –debuglevel Debug Level Set Debug Level 1
2
3
-s –configfile Configuration File A configuration file wmi.config
-d –option=name=value Option List of Options
-n –netbios Netbios Name The computer name in windows dbServer
-W –workgroup Workgroup In MS Windows, the domain or workgroup name LABDomain
–realm Realm The name of the realm
-U –user Domain Name\Username%Password User Credentials [DOMAIN\]USERNAME[%PASSWORD]]
[DOMAIN\]USERNAME
USERNAME
–password Password The password for the user-specified with -U
-A –authentication-file Authentication File The authentication file
–namespace Namespace WMI Namespace The namespace for the WMI Class
–delimiter Delimiter Supply a delimiter to have the returned columns separated by other than the default delimiter The default delimiter is |

 

Use Scenario

Use Credential supplied as domain/user%password

Syntax


wmic -U <domain-name>/<username>%<password> //computer "select Model from Win32_ComputerSystem"

Sample

wmic -U lab/dadeniji%pass1234 //dbDEV "select Model from Win32_ComputerSystem"

Output

Output Image

Output Text
Inspiron

Use Credential supplied as –workgroup // –username // –password

Syntax


wmic --workgroup  <workgroup>  -U <username> --password <password> //computer "select Model from Win32_ComputerSystem"

Sample

wmic --workgroup lab -U dadeniji  --password pass1234 //dbDEV  "select Model from Win32_ComputerSystem"

Output

Output Image
Output Text
Inspiron

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