Powershell script called through Scheduled Task runs slowly/forever

Yet if you manually run it, no problems.

Issue was with Task Scheduler and its Priority field. This is within the XML of the task itself.

If you were to export the task as an XML, browser to the <Priority> section. You’ll see a number there. By default, it’s 7 (‘below normal’). Changing the value to either a 6, 5 or 4 (changes to ‘normal’) will run the task in a timely manner. Do not set it to anything other than normal. Then delete the existing task and re-import the XML you’ve just edited.

As always, exercise caution and think about the reasoning for changing the priority of the task (Microsoft’s explanation here)

Thanks to https://bdbits.wordpress.com/ for this reference, as well as this Reddit thread

Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *