Represents the link between a health service and the RunAs account that should be used on that health service when running a monitor, rule, or task that uses the particular RunAs profile. Namespace: Microsoft.EnterpriseManagement.Monitoring.Security
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)

Usage

Visual Basic
Dim instance As MonitoringSecureDataHealthServiceReference

Syntax

Visual Basic
<SerializableAttribute> _
Public Class MonitoringSecureDataHealthServiceReference
		Inherits CreatableMonitoringBaseWithId
C#
[SerializableAttribute] 
public class MonitoringSecureDataHealthServiceReference : CreatableMonitoringBaseWithId
C++
[SerializableAttribute] 
public ref class MonitoringSecureDataHealthServiceReference : public CreatableMonitoringBaseWithId
J#
/** @attribute SerializableAttribute() */ 
public class MonitoringSecureDataHealthServiceReference extends CreatableMonitoringBaseWithId
JScript
SerializableAttribute 
public class MonitoringSecureDataHealthServiceReference extends CreatableMonitoringBaseWithId

Example

The following example shows how to enumerate all the RunAs profiles and display their contents by using the MonitoringSecureReference class.

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);
			}
		}
	}
} 
}

Inheritance Hierarchy

System.Object
   Microsoft.EnterpriseManagement.Common.MonitoringBase
     Microsoft.EnterpriseManagement.Common.CreatableMonitoringBaseWithId
      Microsoft.EnterpriseManagement.Monitoring.Security.MonitoringSecureDataHealthServiceReference

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