Hello All,
My current need to find who moved a VM into a folder and when and while doing so i have reached till below but not able to find the VM name , it comes up blank.
Further more if we were do dig details as to what was done on a VM historically with respect to tasks what query can be used , looking for atleast a 6 monthly record.
PowerCLI C:\> Get-VIEvent -start 9/1/2017 -MaxSamples 100000 | Where-Object FullFormattedMessage -Match "Task: Move Entities" | Select CreatedTime,UserName,FullFormattedMessage
CreatedTime UserName FullFormattedMessage
----------- -------- --------------------
1/15/2018 1:49:55 PM DOMAIN\Amit.Kadam Task: Move entities
1/15/2018 1:49:42 PM DOMAIN\Amit.Kadam Task: Move entities
1/11/2018 1:00:17 PM DOMAIN\Amit.Kadam Task: Move entities
1/11/2018 1:00:10 PM DOMAIN\Amit.Kadam Task: Move entities
1/11/2018 12:59:50 PM DOMAIN\Amit.Kadam Task: Move entities
1/11/2018 12:59:40 PM DOMAIN\Amit.Kadam Task: Move entities
Afaik, that is the only info you will get out of the event.
Besides the target folder and the datacenter, there is no other info.
Get-VIEvent -Start (Get-Date).AddMinutes(-15) -MaxSamples ([int]::MaxValue) |
where{$_ -is [VMware.Vim.TaskEvent] -and $_.Info.DescriptionId -eq 'Folder.moveInto'} |
Select CreatedTime,UserName,@{N='Datacenter';E={$_.Datacenter.Name}},
@{N='TargetFolder';E={$_.Info.EntityName}}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference