AgentPendingAction Class
[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]
Represents a task that targets an agent on a managed computer. The task is queued or awaiting administrator approval.
Namespace: Microsoft.EnterpriseManagement.Administration
Assembly: Microsoft.EnterpriseManagement.OperationsManager (in Microsoft.EnterpriseManagement.OperationsManager.dll)
Usage
'Usage
Dim instance As AgentPendingAction
Syntax
'Declaration
<SerializableAttribute> _
Public Class AgentPendingAction
Inherits MonitoringBase
[SerializableAttribute]
public class AgentPendingAction : MonitoringBase
[SerializableAttribute]
public ref class AgentPendingAction : public MonitoringBase
/** @attribute SerializableAttribute() */
public class AgentPendingAction extends MonitoringBase
SerializableAttribute
public class AgentPendingAction extends MonitoringBase
Example
The following example shows how to display a list of pending tasks for all servers in a Management Group. In this example, mg is a ManagementGroup instance.
using Microsoft.EnterpriseManagement;
using Microsoft.EnterpriseManagement.Administration;
using Microsoft.EnterpriseManagement.Common;
using Microsoft.EnterpriseManagement.Configuration;
using Microsoft.EnterpriseManagement.Monitoring;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Text;
namespace SDKSamples
{
class Program
{
//-------------------------------------------------------------------
static void Main(string[] args)
{
ManagementGroup mg;
try
{
mg = new ManagementGroup("localhost");
IAdministrationManagement admin = mg.Administration;
IList<AgentPendingAction> actions = admin.GetAgentPendingActions();
foreach(AgentPendingAction action in actions)
{
Console.WriteLine("Action " + action.AgentPendingActionType.ToString() + " on server " +
action.ManagementServerName + " is pending for agent " + action.AgentName);
}
}
catch (Exception e)
{
Console.WriteLine("Could not display pending actions. " + e.Message);
}
}
}
}
// Sample result:
// Action ManualApproval on server Machine1.MyCompany.com is pending for agent Machine2.MyCompany.com
// Action ManualApproval on server Machine1.MyCompany.com is pending for agent Machine3.MyCompany.com
Remarks
You can get a list of all pending tasks in a Management Group using GetAgentPendingActions.
Inheritance Hierarchy
System.Object
Microsoft.EnterpriseManagement.Common.MonitoringBase
Microsoft.EnterpriseManagement.Administration.AgentPendingAction
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 Vista, Windows Server 2003, and
Target Platforms
Change History
See Also
Reference
AgentPendingAction Members
Microsoft.EnterpriseManagement.Administration Namespace
ApproveAgentPendingActions
GetAgentPendingActions
RejectAgentPendingActions