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.
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
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