I got below from api example
TaskInfo runTask = TaskInfoProvider.GetTaskInfo("myTaskName", SiteContext.CurrentSiteID);
I checked myTaskName in CMS_ScheduledTask table and SiteContext.CurrentSiteID in CMS_Site. Both are correct. I am trying to run a schedule task based on button click.
The name way not works. You can get the Id of the task by name and then use the taskID to get taskinfo.
Please, sign in to be able to submit a new answer.