Closed mscsesaamy closed 3 years ago
As you may conclude from the Exception, the error is being thrown by the underlying COM object ITaskService
during the Connect
method. If you look at the help for ERROR_NOT_SUPPORTED
, you'll see a possible cause. This error does show up at times when trying to connect to older systems. Unfortunately, this is likely a Microsoft problem and not a problem for this library, which is just a wrapper for the complex COM API for Windows Task Scheduler.
The following is working fine in a domain environment TaskService ts = new TaskService("COMPUTERNAME", "remoteUserAcctName", "DOMAINNAME", "remoteUserPassword");
But I tried using the same on my PC it is not working.
Most often when this method works in one environment, but not another, there is a permissions problem. Please see the project Wiki for information about how to test the security settings and correct them.
In the Azure virtual machine, there are several jobs scheduled we tried to access those jobs from my system it is throwing an error as below. System.Runtime.InteropServices.COMException: 'The request is not supported. (Exception from HRESULT: 0x80070032)'
Microsoft.Win32.TaskScheduler.V2Interop.ITaskService.Connect(Object serverName, Object user, Object domain, Object password) at Microsoft.Win32.TaskScheduler.TaskService.Connect() at Microsoft.Win32.TaskScheduler.TaskService..ctor(String targetServer, String userName, String accountDomain, String password, Boolean forceV1)