Using Updating Consumers

The updating consumer is a regular WMI event consumer consisting of an UpdateQL and a WMI event consumer provider, which permits commands expressed in UpdateQL to be executed on user-configurable events.

Note  For information about the support and installation of this component on a specific operating system, see Operating System Availability of WMI Components.

The user interacts with the updating consumer by creating instances of the updating consumer in the WMI repository. The consumer contains a list of commands describing the actions to take when an interesting event occurs.

The updating consumer translates update commands to WMI PutInstance calls.

Only administrators can register and configure updating consumers. Before executing an updating consumer, the security identifier (SID) of the creator is checked to see if it belongs to the local administrative group. Execution will not occur if this condition is not met.

Windows XP with SP1: When you install WMI, the updating consumers are not loaded by default. To install the updating consumers, in Control Panel, double-click Add or Remove Programs, and then click Add/Remove Windows Components.

Errors and Debugging Correlation Scenarios

To facilitate debugging correlation scenarios, updating consumers fire tracing events which can be subscribed to. An error is immediately propagated back to the event subsystem. Thus, if an updating consumer has multiple commands and the execution of any statement fails, none of the subsequent statements are executed.

Because errors occurring in the updating consumer are reported using WMI events, a user can handle these errors and perform additional recovery logic. For example, if the state of a correlation scenario needs to be reset when an error occurs, to ensure that it is in a consistent state, there could be an updating consumer listening for errors, which resets the correlation on each error occurrence.

Tracing events exist at two levels. The first level allows the client to observe the outcome of the execution of an updating consumer. This level is represented by the MSFT_UCTraceEventBase class.

The second level allows you to observe the execution of individual commands within an updating consumer. For commands associated with data queries, there is an event fired for each data object returned from the query. This event object, which causes the execution of the updating consumer, is also stored in this debugging object. These tracing events are represented by MSFT_UCUpdateCommandTraceEvent, MSFT_UCInsertCommandTraceEvent, and MSFT_UCDeleteCommandTraceEvent.