Retrieves a collection of MonitoringSecureDataHealthServiceReference objects. Namespace: Microsoft.EnterpriseManagement
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)

Usage

Visual Basic
Dim instance As ManagementGroup
Dim returnValue As ReadOnlyCollection(Of MonitoringSecureDataHealthServiceReference)

returnValue = instance.GetMonitoringSecureDataHealthServiceReferences

Syntax

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

Return Value

A read-only collection of MonitoringSecureDataHealthServiceReference objects.

Example

The following example demonstrates a use of the GetMonitoringSecureDataHealthServiceReferences method.

C#  Copy Code
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Configuration;
using Microsoft.EnterpriseManagement.Monitoring;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Xml;
using Microsoft.EnterpriseManagement.Monitoring.Security;
using System.Security;

class Program
{
	static void Main(string[] args)
	{
		ReadOnlyCollection<MonitoringSecureDataHealthServiceReference> references;
		ManagementGroup managementGroup;
		managementGroup = new ManagementGroup("localhost");
		references = managementGroup.GetMonitoringSecureDataHealthServiceReferences();
		foreach (MonitoringSecureDataHealthServiceReference reference in references)
		{
			MonitoringObject healthService;
			MonitoringSecureData runAsAccount;
			MonitoringSecureReference runAsProfile;

			healthService = managementGroup.GetMonitoringObject(reference.HealthServiceId);
			runAsAccount = reference.GetMonitoringSecureData();
			runAsProfile = reference.GetMonitoringSecureReference();

			Console.WriteLine("Health Service: {0}", healthService.DisplayName);
			Console.WriteLine("  RunAs Profile: {0}", runAsProfile.DisplayName);
			Console.WriteLine("  RunAs Account: {0}", runAsAccount.Name);
	}
}
}

Remarks

The GetMonitoringSecureDataHealthServiceReferences method helps you to determine which profiles are used by a particular health service and what RunAs account for the particular profile is used by the health service.


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