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