Retrieves a collection of
MonitoringSecureDataHealthServiceReference objects from the
specified health service identifier.
Namespace:
Microsoft.EnterpriseManagement
Assembly: Microsoft.EnterpriseManagement.OperationsManager
(in microsoft.enterprisemanagement.operationsmanager.dll)
Usage
Syntax
Parameters
- healthServiceId
-
The health service identifier for the secure data health service
reference object to get.
Return Value
A read-only collection of
MonitoringSecureDataHealthServiceReference objects.
Example
The following example demonstrates a use of the
GetMonitoringSecureDataHealthServiceReferenceByHealthServiceId
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 MonSecDataHealth
{
static void Main(string[] args)
{
ReadOnlyCollection<MonitoringObject> healthServiceInstances;
ManagementGroup managementGroup;
MonitoringClass healthServiceClass;
managementGroup = new ManagementGroup("localhost");
healthServiceClass = managementGroup.
GetMonitoringClass(SystemMonitoringClass.HealthService);
healthServiceInstances = managementGroup.
GetMonitoringObjects(healthServiceClass);
foreach (MonitoringObject healthService in
healthServiceInstances)
{
Console.WriteLine("Health Service: {0}",
healthService.DisplayName);
ReadOnlyCollection
<MonitoringSecureDataHealthServiceReference> references;
references = managementGroup.
GetMonitoringSecureDataHealthServiceReferenceByHealthServiceId (healthService.Id);
foreach (MonitoringSecureDataHealthServiceReference
reference in references)
{
MonitoringSecureReference runAsProfile;
MonitoringSecureData runAsAccount;
runAsProfile =
reference.GetMonitoringSecureReference();
runAsAccount = reference.GetMonitoringSecureData();
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