Solved

Task Scheduler

Posted on 2014-04-18
5
484 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Synchronize a new Active Directory domain with an existing Office 365 tenant
How to record audio from input sources to your PC – connected devices, connected preamp to record vinyl discs, streaming media, that play through your audio card: Vista, Windows 7, Windows 8, Windows 8.1 and Windows 10 – both 32 bit & 64.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

831 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