Retrieves a collection of
MonitoringSecureDataHealthServiceReference objects.
Namespace: Microsoft.EnterpriseManagement
Assembly: Microsoft.EnterpriseManagement.OperationsManager
(in microsoft.enterprisemanagement.operationsmanager.dll)
Usage
Syntax
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
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