Hi,
I am unable to get VM created, deleted, Cloned and beingdeployed details from below
Get-VIEvent -Start (Get-Date).AddDays(-30) -MaxSamples ([int]::MaxValue) | where{$_ -is [VMware.Vim.VmCreatedEvent] -and $_ -is [VMware.Vim.VmBeingClonedEvent] -and $_ -is [VMware.Vim.VmBeingDeployedEvent] -and $_ -is [VMware.Vim.VmRemovedEvent]} | Sort CreatedTime -Descending | Select CreatedTime, UserName, @{N='VM';E={$_.VM.Name}}, FullformattedMessage | ft -auto
I am seeing blank output
Please help
In your Where-clause, you are stating that each event should be all those types.
You should change the -and in -or in the Where-clause
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
In your Where-clause, you are stating that each event should be all those types.
You should change the -and in -or in the Where-clause
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thank you LucD, that worked.
One quick question, it takes long time to get the output, is there a way to speed up the output ?
Unfortunately not.
The retrieval speed for events has dramatically decreased since vSphere 6.
Even my Get-VIEventPlus function became much slower.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference