Intel AMT Features > WS-Eventing > Use Cases > Enumerate Subscriptions
CollapseAll image

Enumerate Subscriptions

The following steps describe how to determine how many subscribers to WS-Eventing exist to determine if additional subscribers can be added.

1.  Retrieve the instances of CIM_FilterCollection.

2.  To find the required subscription filter, look for an instance of CIM_FilterCollection where the “InstanceID” key equals the desired filter, for example “Intel(r) AMT:All” (see WS-Eventing Event Filters).

3.  For each instance of CIM_FilterCollection, find if it has a CIM_FilterCollectionSubscription association class. The number of CIM_FilterCollectionSubscription objects you find is the number of subscribers that exist.

Click here for a snippet demonstrating this step

You can execute this snippet by inserting it into the execution template found here.

  

$numberOfSubscribers = 0

$instanceID ="Intel(r) AMT:All" # The instance ID of of the desired filter.

$filterCollectionRef =$wsmanConnectionObject.NewReference("SELECT * FROM CIM_FilterCollection WHERE InstanceID='" +$instanceID +"'")

$filterCollectionSubscriptionRef =$wsmanConnectionObject.NewReference("CIM_FilterCollectionSubscription")

$filterCollectionSubscriptionRef.AddSelector("Filter",$filterCollectionRef)

foreach($filterCollectionSubscriptionItem in$filterCollectionSubscriptionRef.Enumerate("http://schemas.dmtf.org/wbem/wsman/1/wsman/SelectorFilter",$null))

{

    $numberOfSubscribers++

}

 

 

Instance Diagram

Classes Used in This Flow

SDK Sample

If there is a sample demonstrating this flow, it is included in the SDK installation file. See SDK Installation Layout for details.

 

See Also:

   WS-Eventing Event Subscribers

 

Copyright © 2006-2022, Intel Corporation. All rights reserved.