如何使用TaskScheduler类来监视Windows任务计划程序作业? [英] How to use TaskScheduler class to monitor Windows Task Scheduler jobs?

查看:74
本文介绍了如何使用TaskScheduler类来监视Windows任务计划程序作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中有7台Windows服务器,每台服务器上都有一些任务安排在任务调度程序下。我想创建一个应用程序,它将在一台机器上运行并监视在所有7台服务器上运行的这些任务。如果任何作业失败,那么
我的应用程序屏幕应该显示服务器名称和失败的任务名称。成功运行此失败任务后,该任务应从我的应用程序屏幕中删除。


我将维护服务器,连接这些服务器的凭据以及数据库中这些服务器中的任务。然后我将开发一个Windows窗体应用程序,它将使用计时器在定期间隔后检查每个任务的状态。


现在,我的问题是如何使用TaskScheduler连接到特定服务器并检查任务的状态?


请给我.net代码。


解决方案

ITaskService :: Connect


ITaskService :: GetRunningTasks


IRunningTask :: get_State


In my project there are 7 Windows servers and on each server there are some tasks scheduled under Task Scheduler. I want to create an application which will run on one machine and monitor these tasks running on all of the 7 servers. If any job fails then my application's screen should display the Server name and Failed Task name. Once this failed task is successfully run then the task should get removed from my application's screen.

I will maintain the servers, credentials to connect these servers and the tasks in those server in a DB. Then I will develop a Windows Forms Application which will use a timer to check status of each task after regular interval.

Now, my question is how to use the TaskScheduler to connect to a specific server and check status of the task?

Please give me the .net code for this.

解决方案

ITaskService::Connect

ITaskService::GetRunningTasks

IRunningTask::get_State


这篇关于如何使用TaskScheduler类来监视Windows任务计划程序作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆