Share via


MonitoringConnectorSubscription.Update Method

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Updates the connector subscription.

Namespace: Microsoft.EnterpriseManagement.ConnectorFramework
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in Microsoft.EnterpriseManagement.OperationsManager.dll)

Usage

'Usage
Dim instance As MonitoringConnectorSubscription

instance.Update

Syntax

'Declaration
Public Sub Update
public void Update ()
public:
void Update ()
public void Update ()
public function Update ()

Example

This example gets the first subscription to the first connector and modifies the subscription description, before the update method is called.

using System;
using System.Collections.ObjectModel;
using System.Text;
using System.Collections.Generic;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Administration;
using Microsoft.EnterpriseManagement.Monitoring;
using Microsoft.EnterpriseManagement.ConnectorFramework;
using Microsoft.EnterpriseManagement.Common;
using Microsoft.EnterpriseManagement.Configuration;

namespace ConnectorSample
{
    class Program
    {
        static void Main(string[] args)
        {
            // Connect to a management group
            ManagementGroup mgmtGroup = new ManagementGroup("localhost");
       
            // Get the first connector. The subscription will be to this object.
            IList<MonitoringConnector> connectors = mgmtGroup.ConnectorFramework.GetConnectors();
            MonitoringConnector connector = connectors[0];
 
            // Update a subscription.
            // Get a collection of subscriptions to the first connector.
            IList<MonitoringConnectorSubscription> subscriptions = mgmtGroup.ConnectorFramework.GetConnectorSubscriptions();
            MonitoringConnectorSubscription subscription = subscriptions[0];
            if (subscriptions.Count> 0)
            {
                subscription.Description= "Modified Subscription Description";
                subscription.Update();
            }
        }
    }
}

Remarks

This method updates the subscription with the latest values.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows Vista, Windows Server 2003, and

Target Platforms

Change History

See Also

Reference

MonitoringConnectorSubscription Class
MonitoringConnectorSubscription Members
Microsoft.EnterpriseManagement.ConnectorFramework Namespace