Solved

Task Scheduler

Posted on 2014-04-18
5
487 Views
Last Modified: 2014-04-20
Everyone,

I run the following command to list the scheduled tasks from Task Scheduler :

$Tasks = Get-ScheduledTask | Where-Object {$_.TaskPath -eq '\' -and $_.State -eq 'Ready'}

Which displays the following result :


TaskPath                                       TaskName                          State    
--------                                       --------                          -----    
\                                              Adobe Flash Player Updater        Ready    
\                                              AdobeAAMUpdater-1.0- Ready    
\                                              AdobeAAMUpdater-1.0-MicrosoftA... Ready    
\                                              CreateChoiceProcessTask           Ready    
\                                              GoogleUpdateTaskMachineCore       Ready    
\                                              GoogleUpdateTaskMachineUA1ceee... Ready    
\                                              GoogleUpdateTaskMachineUA1cf2c... Ready    
\                                              GoogleUpdateTaskMachineUA1cf4f... Ready

How can I change the 'State' column from 'Ready' to Disabled ?
0
Comment
Question by:CaussyR
  • 3
5 Comments
 
LVL 26

Expert Comment

by:pony10us
ID: 40009864
Are you wanting to list the tasks that are disabled?

Change:
 
$_.State -eq 'Ready'

to

$_.State -eq 'Disabled"
0
 

Author Comment

by:CaussyR
ID: 40010214
So the line of powershell i had in my comment displayes the state as ready but i want to disable the task,
0
 

Author Comment

by:CaussyR
ID: 40010216
All tasks that display as 'ready', i need to change the task to 'disabled' so i know the task will not run.
0
 
LVL 19

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
ID: 40010252
$Tasks = Get-ScheduledTask | Where-Object {$_.TaskPath -eq '\' -and $_.State -eq 'Ready'}

$Tasks | Disable-ScheduledTask

Or One liner:

Get-ScheduledTask | Where-Object {$_.TaskPath -eq '\' -and $_.State -eq 'Ready'} | Disable-ScheduledTask
0
 

Author Closing Comment

by:CaussyR
ID: 40011649
Thank you very much for your help, exactly what I was looking for.
0

Featured Post

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following article is intended as a guide to using PowerShell as a more versatile and reliable form of application detection in SCCM.
A quick Powershell script I wrote to find old program installations and check versions of a specific file across the network.
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question