Module wmiutils :: Class WmicAgent
[hide private]

Class WmicAgent

source code

_Agent --+
         |
        WmicAgent

This class wraps WMI client to provide an interface to run WMI queries.

Instance Methods [hide private]
 
__init__(self, shell) source code
 
getWmiData(self, queryBuilder, timeout=0) source code
 
executeWmiQuery(self, queryBuilder, timeout=0)
Execute query and return raw string output
source code
 
getWmiDataWithIntermediateFile(self, queryBuilder, timeout=0)
Execute built query and redirect output to intermediate file on destination, copy file from remote and read output.
source code
 
__generateUniqueId(self) source code
 
__cleanRemoteIntermediateFiles(self, fileName, remoteShareDir, remoteInternalDir) source code
 
close(self) source code
Class Variables [hide private]
  __PROPERTY_NAME_USE_INTERMEDIATE_FILE = 'useIntermediateFileFo...
  __DEFAULT_REMOTE_TEMP_SHARE = "admin$\\Temp"
  __DEFAULT_REMOTE_INTERNAL_TEMP_PATH = "%SystemRoot%\\Temp"
  __WMIC_OUTPUT_ENCODING = "utf-16"
Method Details [hide private]

getWmiData(self, queryBuilder, timeout=0)

source code 
Parameters:
  • timeout - parameter is not used, provided only for unique interface with WmicAgent
Overrides: _Agent.getWmiData

executeWmiQuery(self, queryBuilder, timeout=0)

source code 

Execute query and return raw string output

Raises:
  • ValueError - if WMIC query execution failed
Overrides: _Agent.executeWmiQuery

getWmiDataWithIntermediateFile(self, queryBuilder, timeout=0)

source code 

Execute built query and redirect output to intermediate file on destination, copy file from remote and read output.

Raises:
  • Exception - WMI query failed
  • ValueError - file operation failed

close(self)

source code 
Overrides: _Agent.close

Class Variable Details [hide private]

__PROPERTY_NAME_USE_INTERMEDIATE_FILE

Value:
'useIntermediateFileForWmic'