Deletes the specified monitoring connector subscription. Namespace: Microsoft.EnterpriseManagement.ConnectorFramework
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)


Visual Basic
Dim instance As ConnectorFrameworkAdministration
Dim connectorSubscription As MonitoringConnectorSubscription



Visual Basic
Public Sub DeleteConnectorSubscription ( _
		connectorSubscription As MonitoringConnectorSubscription _
public void DeleteConnectorSubscription (
		MonitoringConnectorSubscription connectorSubscription
void DeleteConnectorSubscription (
		MonitoringConnectorSubscription^ connectorSubscription
public void DeleteConnectorSubscription (
		MonitoringConnectorSubscription connectorSubscription
public function DeleteConnectorSubscription (
		connectorSubscription : MonitoringConnectorSubscription



The MonitoringConnectorSubscription object to delete.


The following code deletes a specific subscription.

Visual Basic  Copy Code
Imports System
Imports System.Collections.ObjectModel
Imports System.Text
Imports Microsoft.EnterpriseManagement
Imports Microsoft.EnterpriseManagement.Monitoring
Imports Microsoft.EnterpriseManagement.ConnectorFramework
Imports Microsoft.EnterpriseManagement.Common
Imports Microsoft.EnterpriseManagement.Configuration
Imports Microsoft.EnterpriseManagement.Administration

Namespace ConnectorSample
	Class Program
		Public Overloads Shared Function Main(ByVal args() As String) As Integer
			' Connect to a management group
			Dim mgmtGroup As New ManagementGroup("localhost")
			' Get a reference to the connector framework administration object.
			Dim cfAdmin As ConnectorFrameworkAdministration = mgmtGroup.GetConnectorFrameworkAdministration()

			' Get all of the subscriptions
			Dim subscriptions As ReadOnlyCollection(Of MonitoringConnectorSubscription) = cfAdmin.GetConnectorSubscriptions()
			' Delete the subscription with the specified DisplayName

			For Each subscription As MonitoringConnectorSubscription In subscriptions
				If subscription.DisplayName = "Delete this subscription" Then
				End If
			Next subscription

		End Function 'Main 
	End Class 'Program
End Namespace 'ConnectorSample
C#  Copy Code
using System;
using System.Collections.ObjectModel;
using System.Text;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Monitoring;
using Microsoft.EnterpriseManagement.ConnectorFramework;
using Microsoft.EnterpriseManagement.Common;
using Microsoft.EnterpriseManagement.Configuration;
using Microsoft.EnterpriseManagement.Administration;

namespace ConnectorSample
	class Program
		static void Main(string[] args)
			// Connect to a management group
			ManagementGroup mgmtGroup = new ManagementGroup("localhost");
			// Get a reference to the connector framework administration object.
			ConnectorFrameworkAdministration cfAdmin = mgmtGroup.GetConnectorFrameworkAdministration();
			// Get all of the subscriptions
			ReadOnlyCollection<MonitoringConnectorSubscription> subscriptions = cfAdmin.GetConnectorSubscriptions();
			// Delete the subscription with the specified DisplayName
			foreach (MonitoringConnectorSubscription subscription in subscriptions)
				if (subscription.DisplayName == "Delete this subscription")



After a subscription is deleted, new alerts will not be marked for a monitoring connector. A monitoring connector subscription defines the criteria that are used to identify alerts that should be marked for a particular connector.

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.


Development Platforms

Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP

Target Platforms

Windows Server 2008,Windows Server 2003,Windows Vista,Windows XP

See Also