__FilterToConsumerBinding

Filter To Consumer Binding
rootkey : Consumerkey : Filter

Is used in the registration of permanent event consumers to relate an instance of the __EventConsumer to an instance of __EventFilter.

On this page

Main example

List instances

# All instances of __FilterToConsumerBinding, with the main properties
Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -Property @(
        'DeliverSynchronously'
        'DeliveryQoS'
        'MaintainSecurityContext'
        'SlowDownProviders'
    )

Examples

Filter with WQL

# WQL filter evaluated by the provider: DeliveryQoS = 0 (WMIMSG_FLAG_QOS_SYNCHRONOUS)
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Filter    = 'DeliveryQoS = 0'
}
Get-CimInstance @cimParameters |
    Select-Object -Property @(
        'DeliverSynchronously'
        'DeliveryQoS'
        'MaintainSecurityContext'
        'SlowDownProviders'
    )

The filter is evaluated by the WMI provider: less data is transferred than with Where-Object.

Decode numeric values

# Lookup table for DeliveryQoS (values documented by Microsoft)
$deliveryQoSName = @{
    0 = 'WMIMSG_FLAG_QOS_SYNCHRONOUS'
    1 = 'WMIMSG_FLAG_QOS_EXPRESS'
}

Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -Property @(
        'DeliverSynchronously'
        @{ Name = 'DeliveryQoS'; Expression = { $deliveryQoSName[[int]$_.DeliveryQoS] } }
        'MaintainSecurityContext'
        'SlowDownProviders'
    )

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  = '__FilterToConsumerBinding'
        Namespace  = 'root'
    }
    Get-CimInstance @cimParameters |
        Select-Object -Property @(
            'DeliverSynchronously'
            'DeliveryQoS'
            'MaintainSecurityContext'
            'SlowDownProviders'
        )
} 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 __FilterToConsumerBinding -Namespace 'root'
$cimClass.CimClassProperties |
    Select-Object -Property Name, CimType, Flags

Properties

7 of 7 properties
NameTypeAccessDescription
Consumer key__EventConsumerread/write

Reference to an instance of __EventConsumer that represents the object path to a logical consumer, the recipient of an event. A logical consumer is an instance of a class derived from __EventConsumer.

Code
# Value of Consumer for each instance
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Property  = 'Consumer'
}
Get-CimInstance @cimParameters |
    Select-Object -Property Consumer

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Consumer on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ Consumer = $null }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
CreatorSIDuint8[]read/write

Security identifier (SID) that uniquely identifies the user who created the binding. Depending on the operating system, WMI stores the Administrator SID or the SID of the user that creates an instance of __FilterToConsumerBinding. For more information, see Binding an Event Filter with a Logical Consumer and Monitoring and Responding to Events with Standard Consumers.

Code
# Value of CreatorSID for each instance
# CreatorSID is an array: -ExpandProperty returns its items one by one
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Property  = 'CreatorSID'
}
Get-CimInstance @cimParameters |
    Select-Object -ExpandProperty CreatorSID

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes CreatorSID on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ CreatorSID = @(0) }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
DeliverSynchronouslybooleanread/write

Obsolete. Instead use the DeliveryQoS property in place of this property, because if DeliverSynchronously is set to True it overrides the setting of the DeliveryQoS property.

Code
# Value of DeliverSynchronously for each instance
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Property  = 'DeliverSynchronously'
}
Get-CimInstance @cimParameters |
    Select-Object -Property DeliverSynchronously

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes DeliverSynchronously on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ DeliverSynchronously = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
DeliveryQoSuint32read/write

Quality of service for a subscription. If the DeliverSynchronously property is set to True, it overrides the setting of the DeliveryQoS property.

Values (2)
ValueLabelDescription
0WMIMSG_FLAG_QOS_SYNCHRONOUSSynchronous delivery **False**. The event is delivered to the logical consumer synchronously.
1WMIMSG_FLAG_QOS_EXPRESSExpress delivery **True**. The event is delivered to the logical consumer asynchronously.
Code
# Value of DeliveryQoS for each instance
# Lookup table for DeliveryQoS (values documented by Microsoft)
$deliveryQoSName = @{
    0 = 'WMIMSG_FLAG_QOS_SYNCHRONOUS'
    1 = 'WMIMSG_FLAG_QOS_EXPRESS'
}
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Property  = 'DeliveryQoS'
}
Get-CimInstance @cimParameters |
    Select-Object -Property @(
        @{ Name = 'DeliveryQoS'; Expression = { $deliveryQoSName[[int]$_.DeliveryQoS] } }
    )

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes DeliveryQoS on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ DeliveryQoS = 0 }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
Filter key__EventFilterread/write

Reference to an instance of __EventFilter that represents the object path to an event filter which is a query that specifies the type of event to be received.

Code
# Value of Filter for each instance
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Property  = 'Filter'
}
Get-CimInstance @cimParameters |
    Select-Object -Property Filter

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes Filter on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ Filter = $null }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
MaintainSecurityContextbooleanread/write

If True, the events are delivered in the same security context that the provider was in when it provided them.

Note: Only a consumer implemented as a DLL (an in-process consumer) can receive events in the security context of the provider. For more information about in-process providers and security, see Provider Hosting and Security. For more information and examples, see Receiving Events Securely.

Code
# Value of MaintainSecurityContext for each instance
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Property  = 'MaintainSecurityContext'
}
Get-CimInstance @cimParameters |
    Select-Object -Property MaintainSecurityContext

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes MaintainSecurityContext on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ MaintainSecurityContext = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters
SlowDownProvidersbooleanread/write

If True, providers are slowed down if this consumer cannot keep up.

Code
# Value of SlowDownProviders for each instance
$cimParameters = @{
    ClassName = '__FilterToConsumerBinding'
    Namespace = 'root'
    Property  = 'SlowDownProviders'
}
Get-CimInstance @cimParameters |
    Select-Object -Property SlowDownProviders

Warning. Changes the system: check with -WhatIf first. An elevated console is often required.

# Warning: changes SlowDownProviders on the instance. -WhatIf shows the operation without running it.
# Target instance
$instance = Get-CimInstance -ClassName __FilterToConsumerBinding -Namespace 'root' |
    Select-Object -First 1
$setParameters = @{
    InputObject = $instance
    Property    = @{ SlowDownProviders = $false }
    WhatIf      = $true  # Remove this line to actually apply the change
}
Set-CimInstance @setParameters

Remarks

The __FilterToConsumerBinding class is derived from __IndicationRelated, which has no properties.

Permanent event consumers use the __FilterToConsumerBinding system class to bind event filters to final consumers. After the filter and consumer are bound together, WMI can forward events that match the filter to the corresponding consumer.

Inheritance

Superclass chain

  1. __SystemClass
  2. __IndicationRelated
  3. __FilterToConsumerBinding

Known subclasses

No known subclass.

Requirements

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

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.