Freigeben über


MSFT_WmiSelfEvent class

The MSFT_WmiSelfEvent abstract troubleshooting classrepresents events occurring in the WMI service itself. You can subscribe to this class to receive notifications of events derived from this class.

The following syntax is simplified from Managed Object Format (MOF) code and includes all inherited properties. Properties and methods are in alphabetic order, not MOF order.

Syntax

[AMENDMENT]
class MSFT_WmiSelfEvent : __ExtrinsicEvent
{
  uint8  SECURITY_DESCRIPTOR[];
  uint64 TIME_CREATED;
};

Members

The MSFT_WmiSelfEvent class has these types of members:

Properties

The MSFT_WmiSelfEvent class has these properties.

SECURITY_DESCRIPTOR

Data type: uint8 array

Access type: Read-only

Descriptor that the event provider uses to determine which users can receive the event. For more information, see WMI Security Constants.

This property is inherited from __Event

TIME_CREATED

Data type: uint64

Access type: Read-only

Unique value that indicates the time the event is generated. This is a 64-bit value that represents the number of 100-nanosecond intervals after January 1, 1601. The information is in the Coordinated Universal Time (UTC) format.

For more information about using uint64 values in scripts, see Scripting in WMI.

This property is inherited from __Event

Remarks

You can subscribe to MSFT_WmiSelfEvent by the following query:

Select * from MSFT_WmiSelfEvent

Derived events include:

Examples

The following VBScript code example polls for occurrences of MSFT_WmiSelfEvent every 10 seconds. The received object, objReceivedEvent, represents an instance of an event class; for example, WMI may generate an instance of MSFT_WmiProvider_UnloadOperationEvent when a cached provider is unloaded.

The call to SWbemServices.ExecNotificationQuery is semisynchronous by default. This script runs and waits for events indefinitely. To stop script execution, use Task Manager to stop the process running Windows Script Host.

strComputer = "." 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2") 
Set objEvents = objWMIService.ExecNotificationQuery("SELECT * FROM MSFT_WmiselfEvent WITHIN 10")
Wscript.Echo "Waiting for MSFT_WmiselfEvent events"
Do While True
    Set objReceivedEvent = objEvents.NextEvent
    Wscript.Echo "Event has occurred: Event class is " & objReceivedEvent.Path_.Class
Loop

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Namespace
Root\CIMV2
MOF
System.mof
DLL
WmiPrvSD.dll

See also

__ExtrinsicEvent

WMI Troubleshooting Classes

Monitoring Events

Receiving a WMI Event