Assembly: Microsoft.EnterpriseManagement.OperationsManager (in microsoft.enterprisemanagement.operationsmanager.dll)
Usage
Visual Basic |
---|
Dim instance As MonitoringSecureReference |
Syntax
Visual Basic |
---|
<SerializableAttribute> _ Public Class MonitoringSecureReference Inherits ManagementPackSecureReference Implements IMonitoringBase |
C# |
---|
[SerializableAttribute] public class MonitoringSecureReference : ManagementPackSecureReference, IMonitoringBase |
C++ |
---|
[SerializableAttribute] public ref class MonitoringSecureReference : public ManagementPackSecureReference, IMonitoringBase |
J# |
---|
/** @attribute SerializableAttribute() */ public class MonitoringSecureReference extends ManagementPackSecureReference implements IMonitoringBase |
JScript |
---|
SerializableAttribute public class MonitoringSecureReference extends ManagementPackSecureReference implements IMonitoringBase |
Example
The following example shows how to enumerate all the RunAs profiles and display their contents 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); } } } } } |
Remarks
RunAs profiles are used with tasks, rules, and monitors when the default set of credentials has insufficient rights. RunAs profiles and their associated credentials are deployed to the targeted computers.
Inheritance Hierarchy
System.Object
Microsoft.EnterpriseManagement.Configuration.ManagementPackItem
Microsoft.EnterpriseManagement.Configuration.ManagementPackElement
Microsoft.EnterpriseManagement.Configuration.ManagementPackAccessibleElement
Microsoft.EnterpriseManagement.Configuration.ManagementPackSecureReference
Microsoft.EnterpriseManagement.Configuration.MonitoringSecureReference
Microsoft.EnterpriseManagement.Configuration.ManagementPackItem
Microsoft.EnterpriseManagement.Configuration.ManagementPackElement
Microsoft.EnterpriseManagement.Configuration.ManagementPackAccessibleElement
Microsoft.EnterpriseManagement.Configuration.ManagementPackSecureReference
Microsoft.EnterpriseManagement.Configuration.MonitoringSecureReference
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.