Solved

Task Scheduler

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Utilizing an array to gracefully append to a list of EmailAddresses
"Migrate" an SMTP relay receive connector to a new server using info from an old server.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

947 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now