How would I use get-vievent to view all the following?
-All exports of virtual machines from vCenter
-All exports of virtual machines from an ESXi host
-All downloads of vmdk files from a datastore using Vmware client or copy operations on the vmdk from the dcui / ssh console?
The idea is see every time a vmdk may have left the environment.
You can report on exports (OVA or OVF) with the following
$start = (Get-Date).AddHours(-1)
Get-VIEvent -Start $start -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.TaskEvent] -and $_.Info.DescriptionId -eq 'VirtualMachine.ExportVmLRO'} |
Select CreatedTime,UserName,@{N='VM';E={$_.VM.Name}},FullFormattedMessage,
@{N='Event';E={$_.Info.DescriptionId}}
Downloading files through the datastore browser doesn't create any events afaik.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
You can report on exports (OVA or OVF) with the following
$start = (Get-Date).AddHours(-1)
Get-VIEvent -Start $start -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.TaskEvent] -and $_.Info.DescriptionId -eq 'VirtualMachine.ExportVmLRO'} |
Select CreatedTime,UserName,@{N='VM';E={$_.VM.Name}},FullFormattedMessage,
@{N='Event';E={$_.Info.DescriptionId}}
Downloading files through the datastore browser doesn't create any events afaik.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
ok great thanks!