2

I am trying to get a list of scheduled tasks from within the task scheduler. Seemingly when you run the Get-ScheduledTask cmdlet it would appear to be hard coded to look within the C:\Windows\Tasks. However, I need to export a list of tasks from C:\Windows\System32\Tasks. I have tried specifying this task path and changed the file type to. job as it said this is the file type for Task Scheduler Task Object that also did not work. Below is the error I seem to get when looking for the specific file path:

No matching MSFT_ScheduledTask objects found by CIM query for instances of the Root/Microsoft/Windows/TaskScheduler/MSFT_ScheduledTask class on the CIM server: SELECT * FROM MSFT_ScheduledTask WHERE ((TaskName LIKE '%')) AND ((TaskPath LIKE 'C:\Windows\System32\Tasks\ADPhoneBookScript')). Verify query parameters and retry. At line:1 char:1

  • Get-ScheduledTask -TaskName * -TaskPath "C:\Windows\System32\Tasks

I have tried many other fixes like moving to another folder in case of a permissions error but seemingly no joy.

Does anyone have any ideas?

1 Answer 1

1

I had this issue as well. Run the command in an elevated prompt. Both of these worked for me to return a list of tasks once I elevated.

Get-ScheduledTask and Get-ScheduledTask -Taskpath "\Our Tasks\*"

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.