Difference between revisions of "WMI client (WMIC) for Linux"

From RHS Wiki
Jump to navigation Jump to search
(Created page with "== Windows Management Instrumentation (WMI) == [http://msdn.microsoft.com/de-de/library/ms811533.aspx WMI] Allows you to remotely execute commands and query parameters on a W...")
 
Line 8: Line 8:
 
   dpkg -i libwmiclient1_1.3.14-3_amd64.deb
 
   dpkg -i libwmiclient1_1.3.14-3_amd64.deb
 
   dpkg -i wmi-client_1.3.14-3_amd64.deb
 
   dpkg -i wmi-client_1.3.14-3_amd64.deb
 +
 +
== Examples ==
 +
=== get the size of the WorkingSet of the process “java.exe” running on the remote host 192.168.20.20 ===
 +
wmic -U Administrator%mysecret //192.168.20.20 "Select WorkingSetSize from Win32_Process Where CommandLine like '%java.exe%'"
 +
=== Get process ID for process ===
 +
wmic -U Administrator%mysecret //10.140.10.10 "Select ProcessId from Win32_Process Where CommandLine like '%java.exe%'"
 +
=== Get WorkingSetSize for process ===
 +
wmic -U Administrator%mysecret //10.140.10.10 "Select WorkingSetSize from Win32_Process Where CommandLine like '%java.exe%'"
 +
=== Get thread count for process ===
 +
wmic -U Administrator%mysecret //10.140.10.10 "Select ThreadCount from Win32_Process Where CommandLine like '%java.exe%'"
 +
=== Get private bytes for process ===
 +
wmic -U Administrator%mysecret //10.140.10.10 "Select PrivateBytes from Win32_PerfFormattedData_PerfProc_Process Where IDProcess='%java.exe%'"
 +
=== Get free physical memory for host ===
 +
wmic -U Administrator%mysecret //10.140.10.10 "Select FreePhysicalMemory from Win32_OperatingSystem"

Revision as of 10:18, 1 February 2016

Windows Management Instrumentation (WMI)

WMI Allows you to remotely execute commands and query parameters on a Windows Host

Linux

In order to be able to communicate with WMI from Linux you need to install this functionability.
For Ubuntu 14.04:
Download this libraries and install them:

 dpkg -i libwmiclient1_1.3.14-3_amd64.deb
 dpkg -i wmi-client_1.3.14-3_amd64.deb

Examples

get the size of the WorkingSet of the process “java.exe” running on the remote host 192.168.20.20

wmic -U Administrator%mysecret //192.168.20.20 "Select WorkingSetSize from Win32_Process Where CommandLine like '%java.exe%'"

Get process ID for process

wmic -U Administrator%mysecret //10.140.10.10 "Select ProcessId from Win32_Process Where CommandLine like '%java.exe%'"

Get WorkingSetSize for process

wmic -U Administrator%mysecret //10.140.10.10 "Select WorkingSetSize from Win32_Process Where CommandLine like '%java.exe%'"

Get thread count for process

wmic -U Administrator%mysecret //10.140.10.10 "Select ThreadCount from Win32_Process Where CommandLine like '%java.exe%'"

Get private bytes for process

wmic -U Administrator%mysecret //10.140.10.10 "Select PrivateBytes from Win32_PerfFormattedData_PerfProc_Process Where IDProcess='%java.exe%'"

Get free physical memory for host

wmic -U Administrator%mysecret //10.140.10.10 "Select FreePhysicalMemory from Win32_OperatingSystem"