VMware Cloud Community
srajsenthil
Contributor
Contributor
Jump to solution

Get events specific to the VM

Hello, I am trying to get the events that are triggered by the vm. Using vsphere, Please see the attachment. I could connect to the server and get the attached events.

The same events, I want to retrieve it using preferably vijava or PowerCli.

Let me know if you want more information.

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

You can do something like this.

It will return the events for the last day.

$vmName = 'MyVM'

$vm = Get-VM -Name $vmName

Get-VIEvent -Entity $vm -Start (Get-Date).AddDays(-1) -MaxSamples ([int]::MaxValue)


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

View solution in original post

0 Kudos
1 Reply
LucD
Leadership
Leadership
Jump to solution

You can do something like this.

It will return the events for the last day.

$vmName = 'MyVM'

$vm = Get-VM -Name $vmName

Get-VIEvent -Entity $vm -Start (Get-Date).AddDays(-1) -MaxSamples ([int]::MaxValue)


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

0 Kudos