Retrieves a collection of all the secure data objects to which the
user has access.
Namespace:
Microsoft.EnterpriseManagement
Assembly: Microsoft.EnterpriseManagement.OperationsManager
(in microsoft.enterprisemanagement.operationsmanager.dll)
Usage
Syntax
Example
The following example uses the
GetMonitoringSecureData method to enumerate RunAs
accounts.
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<MonitoringSecureData> accountsInfo;
ManagementGroup managementGroup;
managementGroup = new ManagementGroup("localhost");
accountsInfo = managementGroup.GetMonitoringSecureData();
foreach (MonitoringSecureData accountInfo in accountsInfo)
{
Console.WriteLine("Account Display Name: {0}", accountInfo.Name);
Console.WriteLine("\tType: {0}", accountInfo.Type.ToString());
if (accountInfo is MonitoringUserNameAndDomainSecureData)
{
Console.WriteLine("\tDomain Name: {0}", ((MonitoringUserNameAndDomainSecureData)accountInfo).Domain);
}
if (accountInfo is MonitoringUserNameSecureData)
{
Console.WriteLine("\tUser Name: {0}", ((MonitoringUserNameSecureData)accountInfo).UserName);
}
}
}
}
}
|
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