VMware Cloud Community
tdubb123
Expert
Expert
Jump to solution

getting task events from 4/1/2016 on vm

how do I get task events on a vm from date 4/1/2016 to 4/30/2016?

get-vievents only gets the events. what about tasks?

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

A Task fires a TaskEvent, you could do something like this

$start = Get-Date "April 1 2016"

$finish = Get-Date "April 30 2016"

$vm = Get-VM -Name MyVM

Get-VIEvent -Entity $vm -Start $start -Finish $finish -MaxSamples ([int]::MaxValue) |

where{$_ -is [VMWare.Vim.TaskEvent]}

As an alternative, have a look at my Task Data Mining – An improved Get-Task


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

A Task fires a TaskEvent, you could do something like this

$start = Get-Date "April 1 2016"

$finish = Get-Date "April 30 2016"

$vm = Get-VM -Name MyVM

Get-VIEvent -Entity $vm -Start $start -Finish $finish -MaxSamples ([int]::MaxValue) |

where{$_ -is [VMWare.Vim.TaskEvent]}

As an alternative, have a look at my Task Data Mining – An improved Get-Task


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
tdubb123
Expert
Expert
Jump to solution

Thanks Lucd

0 Kudos