0

We have a script that is a security script, checking logs. Almost always it can be ignored and, for the most part, is; it sends out an email when it sees an issue in some logs of a particular type, which shouldn't happen too often.

We kick off this script (PowerShell) via Windows Task Scheduler on a Windows Server. The account used is a team service account, and so it's used for other things. Unfortunately if the password on this account is changed and the changer forgets to update the Windows Task Scheduler task, the task fails to run. Since the task is designed to only contact users when something is wrong, it's easy to not know the task has been failing for months at a time.

Is there some way to be notified when a task has a critical failure like this?

Ranger
  • 703
  • 2
  • 7
  • 12
  • so this task only runs under that user? Another schedule to check the other schedule would that work? Does the computer get booted many times in the long delay between no-one knowing it had failed? would it be sufficient to check at boot (or many boots) that the task had not run in X boots? – Psycogeek Jun 02 '16 at 18:55
  • @Psycogeek It doesn't reboot very often at all, but even if it did: how do I run a task to check if the tasks are failing to start, though? I'd run it under an account--the same account--which would have the exact same issue on a changed password, with no ground gained. 'Who watches the Watchmen?' The linked question doesn't seem to answer this either. – Ranger Jun 02 '16 at 18:58
  • @Psycogeek But I can't depend on the Task Scheduler to watch the scheduler; as soon as the password of the running account changes _everything_ that is run by the Task Scheduler completely breaks and fails to run entirely. So a Batch called from the Task Scheduler would never find an issue, because if it had the chance to find the issue it _also_ would fail to run. – Ranger Jun 02 '16 at 19:20
  • My lamer method is to write or append simple stuff to simple txt (text like) files from batch, then read those simple text files for what they say in them. That can include dates, or just that the file exists, or that the file has some word in it. The file is then deleted by the batch, or deleted by the other batch, to finish. Batches of that type could also be run from scheduler obviously, at every startup, or other methods one could dream up. DIY event viewer :-) – Psycogeek Jun 02 '16 at 19:22
  • I (barely) understood that, but I did Initially observe in your question, that the (alleged) duplicate would not work in the cases of the schedule never running, so how would anything know the schedule itself had failed, or the batch in the schedule had failed, if None of it is working at that time. By checking that the schedule worked with other methods, that do not use the scheduler. On the other hand, schedules dont have to depend on users, they can be run system? the system schedules dont all fail because of users or password changes? that I don't understand. – Psycogeek Jun 02 '16 at 19:33

0 Answers0