MonitoringConnectorSubscription.Update Method

Updated: April 16, 2012

Updates the connector subscription. Namespace: Microsoft.EnterpriseManagement.ConnectorFramework
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in Microsoft.EnterpriseManagement.OperationsManager.dll)Dim instance As MonitoringConnectorSubscription instance.UpdatePublic Sub Updatepublic void Update ()public: void Update ()public void Update ()public function Update ()

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";

This method updates the subscription with the latest values.

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

Development Platforms

Windows Vista, Windows Server 2003, and

Target Platforms