Windows Management Infrastructure(WMIC) Installation and Configuration

1] Download WMIC
ashok-pc:~# cd /tmp
ashok-pc:/tmp# wget http://www.edcint.co.nz/checkwmiplus/wmi-1.3.14.tar.gz
–2012-11-18 17:23:45– http://www.edcint.co.nz/checkwmiplus/wmi-1.3.14.tar.gz
Resolving http://www.edcint.co.nz… 50.22.11.45
Connecting to http://www.edcint.co.nz|50.22.11.45|:80… connected.
HTTP request sent, awaiting response… 200 OK
Length: 3994744 (3.8M) [application/x-gzip]
Saving to: “wmi-1.3.14.tar.gz”
100%[=========================================================================================>] 3,994,744 419K/s in 11s
2012-11-18 17:23:57 (366 KB/s) – “wmi-1.3.14.tar.gz” saved [3994744/3994744]

2] Unpack WMIC
ashok-pc:/tmp# tar xzvf wmi-1.3.14.tar.gz
ashok-pc:/tmp# cd wmi-1.3.14

3] Compile WMIC (takes about 5-10 minutes)
ashok-pc:/tmp/wmi-1.3.14# make

4] Test WMIC
ashok-pc:/tmp/wmi-1.3.14#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”
ashok-pc:/tmp/wmi-1.3.14#/bin/wmic -U USER%PASS //HOST ‘Select Caption From Win32_OperatingSystem’
CLASS: Win32_OperatingSystem
Caption|Name
Microsoft Windows XP Professional|Microsoft Windows XP Professional|C:\WINDOWS|\Device\Harddisk0\Partition1

Advertisements

About ashokabhat

I am a C,C ,JAVA,Adobe Flex,.NET Programmer Currently working as a Software Developer
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s