VMware Cloud Community
ecrosby
Contributor
Contributor

View all Scheduled Tasks of VMs

Does anyone know if there is a way to view all Scheduled Tasks of all VMs from vCenter? Is there potentially a PowerCLI command that could be used to gather this information?

6 Replies
msripada
Virtuoso
Virtuoso

Hello,

Am not good with powercli but i found this if it is helpful for you.

Task/Events for a ESX or VM: PowerCLI script

Thanks,

MS

Reply
0 Kudos
daphnissov
Immortal
Immortal

In PowerCLI you can accomplish this with a Get-View of the ScheduledTaskManager object like so.

(Get-View ScheduledTaskManager).ScheduledTask | %{(Get-View $_).Info} | Select Name,NextRunTime

It will return for any object in the system. For example, if I schedule two power on tasks for a couple of VMs, I can run this pipeline without specifying those individual objects.

pastedImage_1.png

MRoushdy
Hot Shot
Hot Shot

very helpful

Thanks,

vEXPERT - VCAP-DCV - Blog: arabitnetwork.com | YouTube: youtube.com/c/MohamedRoushdy
Reply
0 Kudos
Wafi_aljunaedi
Contributor
Contributor

Hi

how i can delete this scheduled tasks by PowerCLI?

Best Regards

Tags (1)
Reply
0 Kudos
nettech1
Expert
Expert

Guessing you no longer need the remove script, but it was posted here a month later 

https://communities.vmware.com/t5/VMware-PowerCLI-Discussions/vSphere-6-7-VCSA-Cannot-Edit-Scheduled...

 

modify or remove  where{$_.Info.Name -match 'PRE WSUS'} 

Reply
0 Kudos
scott28tt
VMware Employee
VMware Employee

@ecrosby 

Moderator: Moved to PowerCLI Discussions


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
Reply
0 Kudos