Hi all,
My purpose is collecting the task when vm is running. Then, I always get the exception message "The operation is not supported on the object." when call CreateCollectorForTasks.
I try to use powercli command to clarify the problem. However, it always get error call when I use Get-View TaskManager.
Could someone provide the sample command about TaskManager usage?or tell me the problem about my TaskManager problem.
My code as follows:
TaskManager taskmgr = new TaskManager(_client, _client.ServiceContent.TaskManager);
taskmgr.UpdateViewData();
TaskFilterSpec filter = new TaskFilterSpec();
filter.Entity = new TaskFilterSpecByEntity();
filter.Entity.Entity = _vm.MoRef;
ManagedObjectReference moRf = taskmgr.CreateCollectorForTasks(filter);
TaskHistoryCollector histaskmgr = new TaskHistoryCollector(_client, moRf);