Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
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
Advertisements
