I'm writing a script, but I have a small question ,
I want to list/find all the VMs under a resource pool or OrgVdc, along with the "Creation Date", Deletion Date" of any VMs in that resource pool, ? basically want to find all VMs that existed over a peroid of time when i execute the command.
for example say there is a VM that was created on Jan 10th and it was deleted on Jan 15th , now is there any command in vSphere Power CLI, where if I mention list all the VMs in the ESX or in the resource pool that existed from Jan 1st to Jan 30th, the output should also have the VM listed that was there from Jan 10th to Jan 15th, or is Database is the only way ?
Please give your inputs
The best option is to look at the events with the Get-VIEvent cmdlet.
Most of the activities in your vSphere envrionment produce 1 or more events (as you can see under Tasks & Events in the vSphere client).
There are numerous sample scripts in this community, and a few on my blog.
It will be a matter of finding the correct eventnames that document the lifecycle of a VM