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

Usage

Visual Basic
Dim instance As ConnectorFrameworkAdministration
Dim monitoringConnector As MonitoringConnector

instance.Cleanup(monitoringConnector)

Syntax

Visual Basic
Public Sub Cleanup ( _
		monitoringConnector As MonitoringConnector _
)
C#
public void Cleanup (
		MonitoringConnector monitoringConnector
)
C++
public:
void Cleanup (
		MonitoringConnector^ monitoringConnector
)
J#
public void Cleanup (
		MonitoringConnector monitoringConnector
)
JScript
public function Cleanup (
		monitoringConnector : MonitoringConnector
)

Parameters

monitoringConnector

The MonitoringConnector object to delete.

Example

The following is an example of using the Cleanup method to remove all monitoring connectors from the Operations Manager.

C#  Copy Code
using System;
using System.Collections.ObjectModel;
using System.Text;
using System.ServiceModel;
using Microsoft.EnterpriseManagement;
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 a reference to the connector framework administration object.
			ConnectorFrameworkAdministration cfAdmin = mgmtGroup.GetConnectorFrameworkAdministration();
			// Gets a list of all installed connectors
			ReadOnlyCollection<MonitoringConnector> connectors = cfAdmin.GetMonitoringConnectors();
		
			foreach (MonitoringConnector connector in connectors)
			{
				// A connector must be uninitialized before it can be deleted.
				if (connector.Initialized)
				{
					connector.Uninitialize();
			}
				cfAdmin.Cleanup(connector);
		}
	}
}
}

Remarks

The Cleanup method should be called when a monitoring connector is to be removed permanently.

Before performing a Cleanup, remove any subscriptions associated with the monitoring connector and make sure the monitoring connector is uninitialized.


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 Server 2008, Windows Vista, Windows Server 2003, and Windows XP

Target Platforms

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

See Also