PowerShell Quick tip: Find all scheduled tasks on your server
Applies to
- PowerShell
- Powershell V7
Intro
Task scheduler is brilliant because you can schedule things to run on certain days and times.
But what about if you looking for a scheduled task but there are so many folders to sift through to find them?
PowerShell is the answer, you can run a single command to find all the tasks running on that server.
Running the command
This may also be a good thing if you are infected and something is triggering on a scheduled time, you might be able to pin point it in the list. Here is the command:
Get-ScheduledTask
Here is an example on Windows Server 2016:
https://everything-powershell.com/wp-content/uploads/2021/01/image-2.png
and you can do the same thing with PowerShell V7 as per below:
https://everything-powershell.com/wp-content/uploads/2021/01/get-scheduledtasks.png
The list is quite long but you get the just of it. Much easier than opening up Scheduled Tasks and going through all the folders to find something.
You can also narrow it down to a specific task by using the following command:
Get-ScheduledTask -TaskName "XYZ"
The above is useful if you know what you looking for, you can also search for the Scheduled Task by TaskPath.