Retrieves a collection of all the secure references. Namespace: Microsoft.EnterpriseManagement
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)

Usage

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

returnValue = instance.GetMonitoringSecureReferences

Syntax

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

Return Value

A read-only collection of MonitoringSecureReference objects.

Example

The following example uses the GetMonitoringSecureReferences method to enumerate RunAs profiles and their contents.

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;

namespace SDKSamples
{
	class Program
	{
		static void Main(string[] args)
		{ 	 
			ReadOnlyCollection<MonitoringSecureReference> runAsProfiles;
			ManagementGroup managementGroup;
			managementGroup = new ManagementGroup("localhost");
			runAsProfiles = managementGroup.GetMonitoringSecureReferences();
			foreach (MonitoringSecureReference runAsProfile in runAsProfiles)
			{
				ReadOnlyCollection
					<MonitoringSecureDataHealthServiceReference> 
						healthServiceReferences;

				Console.WriteLine("Profile Name: {0}", runAsProfile.DisplayName);

				healthServiceReferences = managementGroup.GetMonitoringSecureDataHealthServiceReferenceBySecureReferenceId(runAsProfile.Id);

				foreach (MonitoringSecureDataHealthServiceReference reference in healthServiceReferences)
				{
					MonitoringSecureData runAsAccount;
					MonitoringObject	 healthService;

					runAsAccount = reference.GetMonitoringSecureData();

					healthService = managementGroup.GetMonitoringObject(reference.HealthServiceId);

					Console.WriteLine("\t{0} - {1}", healthService.DisplayName, runAsAccount.Name);
			}
		}
	}
} 
}

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