Gets all the monitoring connectors in the Management Group. Namespace: Microsoft.EnterpriseManagement.ConnectorFramework
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)

Usage

Visual Basic
Dim instance As ConnectorFrameworkAdministration
Dim returnValue As ReadOnlyCollection(Of MonitoringConnector)

returnValue = instance.GetMonitoringConnectors

Syntax

Visual Basic
Public Function GetMonitoringConnectors As ReadOnlyCollection(Of MonitoringConnector)
C#
public ReadOnlyCollection<MonitoringConnector> GetMonitoringConnectors ()
C++
public:
ReadOnlyCollection<MonitoringConnector^>^ GetMonitoringConnectors ()
J#
public ReadOnlyCollection<MonitoringConnector> GetMonitoringConnectors ()
JScript
public function GetMonitoringConnectors () : ReadOnlyCollection<MonitoringConnector>

Return Value

A collection of MonitoringConnector objects. It is a collection of all the monitoring connectors in the Management Group.

Example

C#  Copy Code
using System;
using System.Collections.ObjectModel;
using System.Text;
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 a reference to the connector framework administration object.
			ConnectorFrameworkAdministration cfAdmin = mgmtGroup.GetConnectorFrameworkAdministration();

			// Get the first connector. The subscription will be to this object.
			ReadOnlyCollection<MonitoringConnector> connectors = cfAdmin.GetMonitoringConnectors();
			MonitoringConnector connector = connectors[0];
			// Create a subscription
			AlertNotChangedSubscriptionConfiguration config = new AlertNotChangedSubscriptionConfiguration(AlertSubscriptionConfigurationType.Any);
			config.Criteria = "<SimpleExpression><ValueExpression><Property>ResolutionState</Property></ValueExpression><Operator>Equal</Operator><ValueExpression><Value>255</Value></ValueExpression></SimpleExpression>";
			MonitoringConnectorSubscription subscription = new MonitoringConnectorSubscription("AlertSubscription", connector.Id, config);
			subscription.DisplayName = "Alerts Subscription";
			subscription.Description = "Alerts Subscription Description";
			cfAdmin.InsertConnectorSubscription(subscription);
	}
}
}

Remarks

The returned monitoring connector objects allow the retrieval and updating of alerts.


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