Windows Scheduled Task(s) monitoring

Vitor Santos

Recommended Posts

Hello folks,

We had a request from a client where he had the need to monitor some important scheduled task(s).
While checking the documentation, we wanted to avoid the procedure on the actual 'Job Monitor' for scheduled tasks (since the clients is kind of harsh when it comes to make changes in their boxes, even if those represent no harm).

Since we were only interested in the actual task return code (after its run), we've done a quick DS (powershell).
Just sharing it here in case it's useful for anyone.

GitHub repo -> Here

For now, we're alarming on the actual task return code != 0. Since MS advises that anything differing from that represents some sort of issue. However, if you've any ideas/improvements just let me know :)

Thank you!

Link to comment
Share on other sites

Updated the actual code since the task ExitCode was being output as Decimal & it's easier to present it as HEX on the actual alarm message.
To accomplish that, I've added a function that makes use of LM API & maps a custom property at the instance level (this way we can then reference it in the actual alarm message -> converted to HEX).

Hope it's useful for anyone

Link to comment
Share on other sites

I have updated the actual DS.. Realized that it wasn't getting data from the actual endpoint in context.
I was running PS commands locally (so it was always retrieving data from the Collector :( ).

I've re-wrote it in order to use 'Invoke-Command' & this way it seems to be getting data for each device in context.

Updated the GitHub repo

Link to comment
Share on other sites

  • 7 months later...

I am having issues when I try to use your Data Collection script for this.  The discovery works fine.  When doing the data collection, it times out with no results.  I do have my company defined in the URI.  Can you please point me in the right direction?

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.