Hi there,
Is there a cmdlet (or another method...) of determining the names of virtual machines that were recently removed from the inventory, and the date and time that they were removed?
Would be handy for keeping track of vms that go "missing".
Thanks,
Owen
Sure, something like this will do the trick.
It uses the Get-VIEvent cmdlet.
And the Where-clause is used to filter out the events we're after.
$start = (Get-Date).AddMinutes(-10) Get-VIEvent -Start $start |
where {$_ -is [vmware.Vim.VmRemovedEvent]} |
Select @{N="VM";E={$_.Vm.Name}},CreatedTime,UserName,FullFormattedMessage
You can adjust the Start parameter to go further back in time.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thanks a million Luc! Much appreciated!
Sent from my iPhone
