任务停止时运行脚本 [英] Run Script if Task stops
问题描述
大家好,
好几个星期我想知道如果计划的Windows任务意外停止或没有启动,是否可以运行脚本。
我的想法是创建了一个PowerShell脚本,如果特殊服务意外关闭,它会通过SMTP发送邮件通知。
这对我来说很好。
但是现在我有这种情况我想发送通知邮件,如果任务不再运行,因为我的客户有一个特殊的计划任务。 / p>
如果任务状态切换为"就绪",是否有任何选项可以运行脚本或"停止"?
请告知:)
不,但你可以任务事件日志条目。
Hi there folks,
for some weeks I wonder if it is possible to run a script if a scheduled Windows task stops unexpectedly or did not start.
The idea is that I created a PowerShell script that sends a Mail notification via SMTP if a special service shutdown unexpectedly.
This works fine for me.
But now I have the situation I'd like to send a notification mail if a task does not run any longer because I have a special scheduled task for my customers.
Is there any option to run a script if task state switches to "ready" or "stop"?
Please advise :)
No but you can task the event log entries.
这篇关于任务停止时运行脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!