Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

Task Scheduler

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
CaussyR
Asked:
CaussyR
  • 3
1 Solution
 
pony10usCommented:
Are you wanting to list the tasks that are disabled?

Change:
 
$_.State -eq 'Ready'

to

$_.State -eq 'Disabled"
0
 
CaussyRAuthor Commented:
So the line of powershell i had in my comment displayes the state as ready but i want to disable the task,
0
 
CaussyRAuthor Commented:
All tasks that display as 'ready', i need to change the task to 'disabled' so i know the task will not run.
0
 
Raheman M. AbdulSenior Infrastructure Support Analyst & Systems DeveloperCommented:
$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
 
CaussyRAuthor Commented:
Thank you very much for your help, exactly what I was looking for.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now