scheduled tasks don’t show up in Get-ScheduledTask result

Question:

I have defined some scheduled task using Windows Task Scheduler GUI under “\” [default] path but when i run Get-ScheduledTask in powershell, it does not return them. why?

I have tried with Get-ScheduledTask -TaskName "MyTaskName" with one of my task name but it comes up with “No MSFT_ScheduledTask objects found with property ‘TaskName’ equal to ‘MyTaskName'”

Actually I have tried https://library.octopusdeploy.com/step-template/actiontemplate-windows-scheduled-task-disable but it doesn’t work so I have tried running script directly.

UPDATE
I have found the following script to get task list on http://www.fixitscripts.com/problems/getting-a-list-of-scheduled-tasks:

Thanks in advance for you help.

Answer:

UAC

The result is likely affected by UAC. To see everything try right clicking the PowerShell icon, select Run as Administrator and then run your Get-ScheduledTask command again and see if that changes anything.

Further reading: http://david-homer.blogspot.co.uk/2017/10/not-all-scheduled-tasks-show-up-when.html

Source:

scheduled tasks don’t show up in Get-ScheduledTask result by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply