Main example
List instances
# All instances of __IntervalTimerInstruction, with the main properties
Get-CimInstance -ClassName __IntervalTimerInstruction -Namespace 'root' |
Select-Object -Property TimerId, IntervalBetweenEvents, SkipIfPassedExamples
Filter with WQL
# WQL filter evaluated by the provider: only the instances where SkipIfPassed is TRUE
$cimParameters = @{
ClassName = '__IntervalTimerInstruction'
Namespace = 'root'
Filter = 'SkipIfPassed = TRUE'
}
Get-CimInstance @cimParameters |
Select-Object -Property TimerId, IntervalBetweenEvents, SkipIfPassedThe filter is evaluated by the WMI provider: less data is transferred than with Where-Object.
Query a remote computer (CIM session)
review before running# Name of the remote computer
$computerName = 'SERVER01'
# The CIM session (WSMan by default) can be reused for several queries
$cimSession = New-CimSession -ComputerName $computerName
try {
$cimParameters = @{
CimSession = $cimSession
ClassName = '__IntervalTimerInstruction'
Namespace = 'root'
}
Get-CimInstance @cimParameters |
Select-Object -Property TimerId, IntervalBetweenEvents, SkipIfPassed
} finally {
Remove-CimSession -CimSession $cimSession
}WSMan (WinRM) is used by default. For a host without WinRM, create the session with -SessionOption (New-CimSessionOption -Protocol Dcom). Add -Credential to use another account.
Show the class structure
# Class structure: properties, types and flags (Key, ReadOnly…)
$cimClass = Get-CimClass -ClassName __IntervalTimerInstruction -Namespace 'root'
$cimClass.CimClassProperties |
Select-Object -Property Name, CimType, FlagsProperties
| Name | Type | Access | Description |
|---|---|---|---|
| IntervalBetweenEvents# | uint32 | read | Number of milliseconds between event firings. Code |
| SkipIfPassed# | boolean | read | If TRUE, this event is to be skipped if the interval is already passed. The default is FALSE. This property is inherited from __TimerInstruction. FALSE When WMI or the consumer becomes available again, a notification event will be generated and received. TRUE The timer event does not occur if WMI is unavailable to generate it at the appropriate time interval, or the consumer requesting to receive the event is unavailable. Code |
| TimerId# key | string | read | Unique identifier for this __IntervalTimerInstruction object. This property is inherited from __TimerInstruction. Code |
Remarks
The __IntervalTimerInstruction class is derived from __TimerInstruction.
The event query entered to register for an interval timer event is usually based on the TimerId property. Notification events generated from an interval timer event contain the property NumFirings which contains data reflecting how many events fired during the time the events were unable to be received. If SkipIfPassed is set to TRUE, that information is discarded.
The value for the IntervalBetweenEvents property should be reasonably large. If it is too small, WMI may ignore it and not generate the event due to limitations in some operating systems.
WMI generates the interval timer event by creating an instance of the __TimerEvent class.
To receive these timer events in a temporary event consumer, execute IWbemServices::ExecNotificationQuery with the following event query string:
```sql
SELECT * FROM __TimerEvent WHERE TimerID = "MyEvent"
```
To receive these timer events in a permanent event consumer, you must load the previous query into an event filter, define a logical consumer, and create a filter-to-consumer binding for the filter and consumer. For more information, see Receiving Events at All Times.
Inheritance
Superclass chain
- __SystemClass
- __IndicationRelated
- __EventGenerator
- __TimerInstruction
- __IntervalTimerInstruction
Known subclasses
No known subclass.
Requirements
- Namespace
- root
- Minimum client
- Windows Vista
- Minimum server
- Windows Server 2008
- DLL
- All
Microsoft source
Descriptions, properties and methods come from the Microsoft documentation (MicrosoftDocs/win32 repository), published under the CC BY 4.0 licence. Formatting and translations are specific to this site; the PowerShell examples are written for it.