Hello There,
Is there a way to get the vm name from get-vievent?
I am trying to find all vm's created in the last day (easy) and then get-vm...basic idea...
Thanks for the help!
I didn't look closely at your Where-clause, it should be like the code above.
Please try it like that.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If you only need the VM name, that property is present in the Event object that is returned by Get-VIEvent.
$eventTypes = "VmBeingDeployedEvent","VmCreatedEvent","VmRegisteredEvent","VmClonedEvent"
Get-VIEvent -maxsamples 20000 -Start (Get-Date).AddDays(-1) |
where {$eventTypes -contains $_.Gettype().Name} | select Username, CreatedTime, FullFormattedMessage,@{N="VM";E={$_.VM.Name}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks LucD for the quick reply and direction.
I just tried adding that and now I get no output.
Any ideas?
Thanks!
I didn't look closely at your Where-clause, it should be like the code above.
Please try it like that.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
beautiful.
thanks!