AgentPendingAction Class

Updated: April 16, 2012

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)Dim instance As AgentPendingAction <SerializableAttribute> _ Public Class AgentPendingAction Inherits MonitoringBase[SerializableAttribute] public class AgentPendingAction : MonitoringBase[SerializableAttribute] public ref class AgentPendingAction : public MonitoringBase/** @attribute SerializableAttribute() */ public class AgentPendingAction extends MonitoringBaseSerializableAttribute public class AgentPendingAction extends MonitoringBase

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;

				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 is pending for agent
// Action ManualApproval on server is pending for agent

You can get a list of all pending tasks in a Management Group using GetAgentPendingActions.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Development Platforms

Windows Vista, Windows Server 2003, and

Target Platforms