I know, this is not a nice solution, but working and simple, when you want to know who created a VM, or any Event information from a VM.
I found lots of other script witch solve this problem, but i have to know one indivudal vm creation day, and information about creator.
PowerCLI C:\WINDOWS\system32> $DATE = Get-Date
PowerCLI C:\WINDOWS\system32> Get-VM -Name VMNAME | Get-VIEvent -Types Info -Start $DATE.AddDays(-700) -Finish $DATE | Export-Csv c:\tmp\events.csv -Encoding utf8
In exported Excel file will store information about who created the VM. You will see like this: “Created virtual machine vmname.domain.loc on 192.168.x.x in clustername” and in this row find the account name who created that.
When you think, the vm is older then 700 days, you can change this value in command.
I hope this short article will help for you!
Can I delete this event from PostgreSQL?
Yes, this is vmware! 🙂
You can delete events, tasks and performance datas whitch older then x days by supported solution.
Follow instructions from this KB Article: https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2110031
This is it what you are looking for?
I would like to delete a specific task or a specific event from the database like:
;
BEGIN TRANSACTION;
DELETE FROM vpx_task
WHERE
vpx_task.descriptionid = ‘vim.host.DiskManager.Lease.MapDiskRegion’ AND
vpx_task.username = ‘accountname’
;
COMMIT TRANSACTION;
Sadly, its not working via Task Scheduler, only by running it manually..