vSphere 6.7 VCSA Cannot Edit Scheduled tasks through GUI, need to create a script to delete all Scheduled Tasks and then re-create them with correct runtimes

This post was originally published on this site

I have manually created scheduled tasks for all my prod VMs to take snapshots and send confirmation email at specific times which are prior to allowing Windows Updates.

 

Some of these jobs ran ok and others did not even start. Furthermore I cannot edit them, I would need to delete and recreate them.

 

I am hoping for some help to create a script to delete all Scheduled Tasks with a specific job name like following but I need to know how to do the delete.

 

Get-VIScheduledTasks | Where-Object {$_.Name -like ‘*PRE WSUS*’} | Format-Table -Autosize

 

Once I have done this I want to create a script which pulls in VM names and other fields like time and snapshot names from a CSV to create the scheduled tasks.

 

I see some scripts for this which I can borrow from but any help much appreciated.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.