Use PowerShell to manage Scheduled Tasks in Windows
I check several locations regularly on Windows systems that I run including the Windows Task Manager to list running processes, the autostart entries, and also the scheduled tasks of the system.
I do that for a couple of reasons including security to make sure nothing slipped by and is running on the system that I consider malicious, spyware or unwanted in other ways, but also to debloat the system by disabling, blocking or removing programs from starting with the system or on schedule.
While it is possible to open the Task Scheduler using search, it does not provide you with a clean interface to go through the list of tasks quickly.
A program that I like to use for the task is Nirsoft's excellent Task Scheduler View which, as usual, is portable and highly efficient.
The PowerShell of Windows offers another quick option on Windows 8 and later. The command Get-ScheduledTask returns all or select scheduled tasks of the local computer.
- Open a command prompt window. You can do that with a tap on the Windows-key, typing Powershell.exe, right-clicking on the result, selecting "run as administrator" and hitting enter. Note that the get-scheduledtask command does not require elevation while all management commands do.
- Type Get-ScheduledTask
The basic command lists all tasks of the local computer sorted by path. It only includes the task path, task name and state of the task which may be sufficient at times.
The name helps with the identification of the task while the state highlights whether it is enabled or disabled.
What makes this more powerful however are the parameters that you may add to the command to display additional details or filter tasks.
Here are some command examples that you may find useful:
- Get-ScheduledTask -TaskName Google* returns all tasks that start with Google.
- Get-ScheduledTask -TaskPath \ returns all tasks that are placed in the TaskPath root.
While it is useful to display scheduled tasks this way, you may also manage tasks using the PowerShell. Please note that you need elevated rights to run disable or enable tasks on a system. This means that you need to run PowerShell from an elevated command prompt.
If you run the commands directly, you need to specify task names or paths explicitly. There is a workaround for that though that you can use to enable or disable multiple tasks at once.
Commands that you may find useful are:
- Disable-ScheduledTask -taskname "Adobe Flash Player Updater" disables the task Adobe Flash Player Updater.
- Enable-ScheduledTask -taskname "Adobe Flash Player Updater" enables the task Adobe Flash Player Updater.
- Get-ScheduledTask -taskname Google* | Disable-ScheduledTask disables all tasks the get command returns (starting with Google),