Home > Enterprise >  Trying to find ways to update the "Description" parameter of an existing task in Tasksched
Trying to find ways to update the "Description" parameter of an existing task in Tasksched

Time:09-21

I am trying to disable a Task from task scheduler on multiple remote servers and while I do that I want to update the description of these tasks as well.

Though the command sets to work on schedule tasks are pretty straight forward like: Get-Scheduledtask Disable-ScheduledTask Set-ScheduledTask Etc.

I am unable to find parameters or command line that helps modify the Description of an existing task.

Would appreciate if anyone has any insights on this or was able to find a workaround.

Thank you!

CodePudding user response:

As I alluded to in the comments, this can be solved by:

  1. Fetching the existing task instance
  2. Modifying the description on the existing instance
  3. Updating the task
# fetch existing task object
$task = Get-ScheduledTask "Pooja's Task"

# update the description
$task.Description = "New and improved description!"

# persist the change
$task |Set-ScheduledTask
  • Related