How to start the specific task of the task scheduler using PowerShell?


To start the specific task of the task scheduler using PowerShell, we need to use the Start-ScheduledTask command.

When we run the above command, we need to provide the task name.

For example,

Start-ScheduledTask -TaskName 'FirstTask'

When you check the above task status,

Example

Get-ScheduledTask -TaskName 'FirstTask'

Output:

TaskPath TaskName  State
-------- --------  -----
\        FirstTask Running

To start the task on the remote computer, we first need to connect to the CIMSession of the remote computer and we can use the below command.

$sess = New-CimSession -ComputerName Test1-Win2k12
Get-ScheduledTask -CimSession $sess -TaskName 'FirstTask' | Start-ScheduledTask

We can also start the task directly with the command, Start-ScheduledTask using the CIMSession.

Start-ScheduledTask -TaskName 'FirstTask' -CimSession $sess

Updated on: 28-Dec-2020

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements