Solved

Task Scheduler

Posted on 2014-04-18
5
489 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

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

Suggested Solutions

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

710 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