Trees | Indices | Help |
|
---|
|
|
|||
object | |||
ProvideConstants A class which, when called on a win32com.client.Dispatch object, provides lazy access to constants defined in the typelib. |
|||
x_wmi | |||
x_wmi_invalid_query | |||
x_wmi_timed_out | |||
x_wmi_no_namespace | |||
_wmi_method A currying sort of wrapper around a WMI method name. |
|||
_wmi_object A lightweight wrapper round an OLE WMI object |
|||
_wmi_event Slight extension of the _wmi_object class to allow objects which are the result of events firing to return extra information such as the type of event. |
|||
_wmi_class Currying class to assist in issuing queries against a WMI namespace. |
|||
_wmi_result Simple, data only result for targeted WMI queries which request data only result classes via fetch_as_classes. |
|||
_wmi_namespace A WMI root of a computer system. |
|||
_wmi_watcher Helper class for WMI.watch_for below (qv) |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
True = 1
|
|||
False = 0
|
|||
__VERSION__ = "1.3.2"
|
|||
_DEBUG = 0
|
|||
obj = GetObject("winmgmts:")
|
|||
wbemErrInvalidQuery = obj._constants.wbemErrInvalidQuery
|
|||
wbemErrTimedout = obj._constants.wbemErrTimedout
|
|||
wbemFlagReturnImmediately = obj._constants.wbemFlagReturnImmed
|
|||
wbemFlagForwardOnly = obj._constants.wbemFlagForwardOnly
|
|||
BASE = datetime.datetime(1601, 1, 1)
|
|||
WMI_EXCEPTIONS = {wbemErrInvalidQuery: x_wmi_invalid_query, wb
|
|||
PROTOCOL = "winmgmts:"
|
|||
IMPERSONATION_LEVEL = "impersonate"
|
|||
AUTHENTICATION_LEVEL = "default"
|
|||
NAMESPACE = "root/cimv2"
|
|
Convenience wrapper for displaying all manner of COM errors. Raises a x_wmi exception with more useful information attached @param error_info The structure attached to a pywintypes.com_error |
Convenience wrapper to take a series of date/time elements and return a WMI time of the form yyyymmddHHMMSS.mmmmmm+UUU. All elements may be int, string or omitted altogether. If omitted, they will be replaced in the output string by a series of stars of the appropriate length. @param year The year element of the date/time @param month The month element of the date/time @param day The day element of the date/time @param hours The hours element of the date/time @param minutes The minutes element of the date/time @param seconds The seconds element of the date/time @param microseconds The microseconds element of the date/time @param timezone The timeezone element of the date/time |
Convenience wrapper to take a WMI datetime string of the form yyyymmddHHMMSS.mmmmmm+UUU and return a 9-tuple containing the individual elements, or None where string contains placeholder stars. @param wmi_time The WMI datetime string in yyyymmddHHMMSS.mmmmmm+UUU format @return A 9-tuple of (year, month, day, hours, minutes, seconds, microseconds, timezone) |
Helper function to add an attribute directly into the instance dictionary, bypassing possible __getattr__ calls @param obj Any python object @param attribute String containing attribute name @param value Any python object |
The WMI constructor can either take a ready-made moniker or as many parts of one as are necessary. Eg, <pre class="code"> c = wmi.WMI (moniker="winmgmts:{impersonationLevel=Delegate}//remote") # or c = wmi.WMI (computer="remote", privileges=["!RemoteShutdown", "Security"]) </pre> I daren't link to a Microsoft URL; they change so often. Try Googling for WMI construct moniker and see what it comes back with. For complete control, a named argument "wmi" can be supplied, which should be a SWbemServices object, which you create yourself. Eg, <pre class="code"> loc = win32com.client.Dispatch("WbemScripting.SWbemLocator") svc = loc.ConnectServer(...) c = wmi.WMI(wmi=svc) </pre> This is the only way of connecting to a remote computer with a different username, as the moniker syntax does not allow specification of a user name. If the "wmi" parameter is supplied, all other parameters are ignored. |
The WMI constructor can either take a ready-made moniker or as many parts of one as are necessary. Eg, <pre class="code"> c = wmi.WMI (moniker="winmgmts:{impersonationLevel=Delegate}//remote") # or c = wmi.WMI (computer="remote", privileges=["!RemoteShutdown", "Security"]) </pre> I daren't link to a Microsoft URL; they change so often. Try Googling for WMI construct moniker and see what it comes back with. For complete control, a named argument "wmi" can be supplied, which should be a SWbemServices object, which you create yourself. Eg, <pre class="code"> loc = win32com.client.Dispatch("WbemScripting.SWbemLocator") svc = loc.ConnectServer(...) c = wmi.WMI(wmi=svc) </pre> This is the only way of connecting to a remote computer with a different username, as the moniker syntax does not allow specification of a user name. If the "wmi" parameter is supplied, all other parameters are ignored. |
Return a remote server running WMI server - name of the server namespace - namespace to connect to: defaults to whatever's defined as default user - username to connect as, either local or domain (dom ame or user@domain for XP) password: leave blank to use current context locale: desired locale in form MS_XXXX (eg MS_409 for Am En) authority: either "Kerberos:" or an NT domain. Not needed if included in user security_flags: if 0, connect will wait forever; if 0x80, connect will timeout at 2 mins named_value_set: typically empty, otherwise a context-specific SWbemNamedValueSet <pre class="code"> c = wmi.WMI (wmi=wmi.connect_server (server="remote_machine", user="myname", password="mypassword")) </pre> |
|
wbemFlagReturnImmediately
|
WMI_EXCEPTIONS
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Oct 29 19:07:35 2009 | http://epydoc.sourceforge.net |