If the virtual machine (VM) creation date or power off date is not currently visible in the vSphere Client, it can be retrieved using the vSphere API.
createDate" and "poweredOffTime" property is located under VCDB. Information can be accessed via supported vSphere API, such as PowerCLI.Note :- VM power-off/creation dates might be sometimes unavailable prior to a recent vCenter reboot.
VMware vCenter Server
Reference Doc: Retention of Events in the vCenter Server Database.
Refer the following steps to identify the creation date of Virtual Machines from the vCenter server.
Connect-VIServer -Server "FQDN_of_vCenterServer"2. Get all VMs and their creation dates using the following command.
$vms = Get-VM | Select-Object Name, @{Name="CreationDate";Expression={$_.ExtensionData.Config.CreateDate}}Refer the following steps to identify the power off date of Virtual Machines from the vCenter server.
The power-off date and time rely on historical data stored in the database.
Connect-VIServer -Server "FQDN_of_vCenterServer"2. Get all VMs and their power off dates using the following command.
$vms = Get-VM | Where-Object -Property PowerState -eq 'PoweredOff' | Select-Object -Property Name, @{Label='poweredOffTime'; Expression={ $_ | Get-VIEvent -Types Info | Where-Object -Property fullformattedmessage -Match 'shutdown|powered off' | Sort-Object -Property CreatedTime | Select-Object -Last 1 -ExpandProperty CreatedTime }}
createDate) with the creation date