Hi All,
Happy Holidays to all.:smileycool:
does any of have the script which gives VM created date for the selected VM's (not all the vCenter VMs).
something like i will put the VM's name in text file (get-content)..:smileyconfused:
Thanks a ton in advance for help.
The following PowerCLI script will retrieve the CreatedTime for all of the virtual machine names listed in a file called VMs.txt:
Get-VIEvent -Entity (Get-VM -Name (Get-Content -Path 'VMs.txt')) -MaxSamples ([int]::MaxValue) |
Where-Object {@('VmBeingDeployedEvent','VmRegisteredEvent','VmClonedEvent','VmBeingCreatedEvent') -contains $_.GetType().Name} |
Select-Object -Property CreatedTime,@{Name='VM';Expression={$_.Vm.Name}}
Thanks for your reply,
i just ran the script giving the path for the VM's mentioned in VMs text file.
But i didnt get any output. neither on powercli console...any thing am i missing..
If the virtual machines in the VMs.txt file are created a long time ago, the events related to the creation of the VMs might already have been removed from the eventlog.
Yes it looks old eventlog removed, but i can we get from vCenter Database.