ManagementGroup.ExecuteMonitoringTask<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
Please use TaskRuntime.ExecuteMonitoringTask<T>()
Executes a task.
public:
generic <typename T>
where T : Microsoft::EnterpriseManagement::Monitoring::PartialMonitoringObject System::Collections::ObjectModel::ReadOnlyCollection<Microsoft::EnterpriseManagement::Runtime::MonitoringTaskResult ^> ^ ExecuteMonitoringTask(System::Collections::Generic::ICollection<T> ^ targets, Microsoft::EnterpriseManagement::Runtime::MonitoringTask ^ task, Microsoft::EnterpriseManagement::Runtime::TaskConfiguration ^ configuration);
[System.Obsolete("Please use TaskRuntime.ExecuteMonitoringTask<T>()")]
public System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.Runtime.MonitoringTaskResult> ExecuteMonitoringTask<T> (System.Collections.Generic.ICollection<T> targets, Microsoft.EnterpriseManagement.Runtime.MonitoringTask task, Microsoft.EnterpriseManagement.Runtime.TaskConfiguration configuration) where T : Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObject;
member this.ExecuteMonitoringTask : System.Collections.Generic.ICollection<'T (requires 'T :> Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObject)> * Microsoft.EnterpriseManagement.Runtime.MonitoringTask * Microsoft.EnterpriseManagement.Runtime.TaskConfiguration -> System.Collections.ObjectModel.ReadOnlyCollection<Microsoft.EnterpriseManagement.Runtime.MonitoringTaskResult> (requires 'T :> Microsoft.EnterpriseManagement.Monitoring.PartialMonitoringObject)
Public Function ExecuteMonitoringTask(Of T As PartialMonitoringObject) (targets As ICollection(Of T), task As MonitoringTask, configuration As TaskConfiguration) As ReadOnlyCollection(Of MonitoringTaskResult)
Type Parameters
- T
Must be of type PartialMonitoringObject.
Parameters
- targets
- ICollection<T>
The entities to target.
- task
- MonitoringTask
The task to submit.
- configuration
- TaskConfiguration
The configuration of the task.
Returns
The task results.
- Attributes
Exceptions
There was an error processing results on the server.
Examples
For an example of the ExecuteMonitoringTaskmethod, see How to Synchronously Run a Management Pack Task