Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Monitoring Windows Scheduled Tasks

Monitoring Windows Scheduled Tasks

Scheduled Pinned Locked Moved Support
6 Posts 2 Posters 64.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M
    M
    mdreher
    wrote on last edited by
    #1

    Hey,

    Wondering what would be the easiest way to monitor the status of a windows scheduled task. 

    Thoughts?

    1 Reply Last reply
    0
    • M
      M
      mdreher
      wrote on last edited by
      #2

      Any thoughts?  Possibly looking at the event logs was my first thought, but wanted to see if anyone had a different idea.

      1 Reply Last reply
      0
      • T
        T
        Tursiops
        wrote on last edited by
        #3

        Hi,

        Use PowerShell to retrieve the status of scheduled tasks:
        https://blogs.technet.microsoft.com/heyscriptingguy/2015/01/12/use-powershell-to-show-results-of-scheduled-tasks/

        You can then monitor specific (or all) tasks using ExternalParameters/ExternalLists/ExternalParametersProvider depending on your exact requirements.

        Cheers

        1 Reply Last reply
        0
        • M
          M
          mdreher
          wrote on last edited by
          #4

          Hmm, ok.  Completely forgot they added powershell for scheduled tasks.  I'm guessing I'd have to use netxms to call an external script then?  Or can the agent run native powershell?

          1 Reply Last reply
          0
          • T
            T
            Tursiops
            wrote on last edited by
            #5

            Hi,

            You can create an ExternalParameter (or ExternalParametersProvider) which can run a handful of commands or call a PowerShell script, which returns the data you are after. If you are after one very specific Scheduled Task, that may be enough. You can also implement an ExternalList, which can call PowerShell to generate a list of Scheduled Tasks you are interested in and which exist on that node, then use this with Instance Discovery to create DCIs for you (using the agent parameter created via ExternalParameter or ExternalParametersProvider).

            For semi-native PowerShell, you can create an ExternalParameter that simply calls powershell -c "$1" (you can tweak that with -noninteractive, -noprofile, etc.), with $1 being the parameter passed from the DCI. We're using the above not as an ExternalParameter, but an Action, so we can run a single, arbitrary PowerShell command on Windows nodes at any time via NetXMS (and lock this object tool down to the users that we trust with that access).
            This method is not suitable for running multi-line commands or scripts of course.

            Cheers

            1 Reply Last reply
            0
            • M
              M
              mdreher
              wrote on last edited by
              #6

              I ended up implementing the log parsing looking for event 203, scheduled task failed.  I definitely like the ideas posted here, if not for this case, then possibly for others.  I really appreciate the feedback.

              1 Reply Last reply
              0

              Hello! It looks like you're interested in this conversation, but you don't have an account yet.

              Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

              With your input, this post could be even better 💗

              Register Login
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              Powered by NodeBB Contributors
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups