__TimerInstruction

Timer Instruction
rootabstractkey : TimerId

Specifies instructions on how timer events should be generated for consumers.

On this page

Main example

List instances

# Abstract class: Get-CimInstance returns the instances of its subclasses
Get-CimInstance -ClassName __TimerInstruction -Namespace 'root' |
    Select-Object -Property TimerId, SkipIfPassed

Abstract class: it has no instances of its own. Get-CimInstance returns the instances of its subclasses (__AbsoluteTimerInstruction, __IntervalTimerInstruction).

Examples

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  = '__TimerInstruction'
        Namespace  = 'root'
    }
    Get-CimInstance @cimParameters |
        Select-Object -Property TimerId, 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 __TimerInstruction -Namespace 'root'
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

2 of 2 properties
NameTypeAccessDescription
SkipIfPassedbooleanread

Describes whether a notification event will be generated and receive when a consumer becomes available.

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
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of SkipIfPassed for each instance
$cimParameters = @{
    ClassName = '__TimerInstruction'
    Namespace = 'root'
    Property  = @('TimerId', 'SkipIfPassed')
}
Get-CimInstance @cimParameters |
    Select-Object -Property TimerId, SkipIfPassed
TimerId keystringread

Unique user-assigned string that identifies this particular timer event. To avoid naming conflicts with other timer identifiers, the string form of a distributed computer environment (DCE)-style GUID can be used. This property is part of the __TimerEvent instance that represents the event.

Code
# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of TimerId for each instance
$cimParameters = @{
    ClassName = '__TimerInstruction'
    Namespace = 'root'
    Property  = 'TimerId'
}
Get-CimInstance @cimParameters |
    Select-Object -Property TimerId

Remarks

The __TimerInstruction class is derived from __EventGenerator.

The __TimerInstruction subclasses are __AbsoluteTimerInstruction, used by consumers to register for an absolute timer event, and __IntervalTimerInstruction, used to register for an interval timer event.

Inheritance

Superclass chain

  1. __SystemClass
  2. __IndicationRelated
  3. __EventGenerator
  4. __TimerInstruction

Known subclasses

Requirements

Namespace
root
Minimum client
Windows Vista
Minimum server
Windows Server 2008
DLL
All
Class qualifiers

abstract

Microsoft source

Source: Microsoft Learn

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.