Leveraging WMI Scripting: Using Windows Management Instrumentation to Solve Windows Management Problems

3.4: Core OS components event providers

3.4 Core OS components event providers

3.4.1 The Clock provider

The Win32 Clock provider is an instance and an event provider. The provider capabilities are summarized in Table 3.34.

Table 3.34: The Win32ClockProvider Providers Capabilities

Provider Name

Provider Namespace

Class Provider

Instance Provider

Method Provider

Property Provider

Event Provider

Event Consumer Provider

Support Get

Support Put

Support Enumeration

Support Delete

Windows XP

Windows Server 2003

Windows 2000 Professional

Windows 2000 Server

Clock Provider

Win32ClockProvider

Root/CIMV2

X

X

X

X

X

X

As shown in Table 3.35, this provider supports two classes: the Win32_LocalTime and Win32_UTCTime classes.

Table 3.35: The Win32ClockProvider Classes

Name

Type

Comments

Win32_LocalTime

Dynamic (Singleton)

Represents an instance of the local time

Win32_UTCTime

Dynamic (Singleton)

Represents an instance of the UTC time

These two classes are created from the Win32_CurrentTime superclass (see Figure 3.18). All classes are singleton classes. There is no particular event class, since the Clock provider works with the __ InstanceModificationEvent intrinsic event class.


Figure 3.18: The Win32_CurrentTime class and its child classes.

Because this provider is implemented as an event provider, it is possible to formulate a WQL query without the WITHIN statement. For example, the following query:

Select * From __InstanceModificationEvent Where TargetInstance ISA 'Win32_LocalTime'

will trigger a notification every time the local time changes. We can obtain the same result by performing...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Communication Service Providers
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.