Score:0

Listing Scheduled Tasks

es flag

Hi I have some powershell code that lists scheduledtasks (Get-ScheduledTask) and processes them. This code works when run interactively, however when run itself as a scheduled task then some scheduled tasks are missing off the list.

I have tried using schdtasks.exe and the same occurs, although sometimes this command duplicates some of the scheduled tasks.

My issue is that I cannot understand why interactively the code is fine, but through a service the code misses out some of the scheduled tasks?

If it help I am querying from a windows clustered service and the missing jobs seem to be those not on the passive node. The task status returned however is always from the active server.

  1. I understood get-scheduledtask only queries the server you are running the code from
  2. What could possibly be a reason why the code run interactively but not from the service? (The impacted services have no specific difference in set up.)

Any constructive thoughts or suggestions would be grateful received.

Just for clarity I have run the code just with get-scheduledtasks|out-file to see what it is picking up. All good interactively, but the above issue through a scheduled job.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.