An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in Microsoft.Win32.TaskScheduler.dll
Additional information:
The request is not supported. (Exception from HRESULT: 0x80070032)
My Code:
using (TaskService tasksrvc = new TaskService(@"\\hqbusa1057", "muthuusername", "igatate", "pwd"))
{
Task task = tasksrvc.FindTask("POC", true); task.Run();
}
I had the same issue caused by the firewall on the requested computer.
Allow 'Remote Scheduled Task Management' in your Windows Firewall to prevent the error when a new TaskService
is created.
Also, allowing 'Remote Event Log Management' may be helpful if you want to access task logs (history).
User contributions licensed under CC BY-SA 3.0