In order to get a sense of what VMs are the oldest, you can find the earliest event stored for each VM and use that as the “creation” time of the VM. Note that this is not a very reliable approach to determining the creation date of a VM, because vCenter events can expire. However, this can at least give you a time by which the VM was created (i.e. it might have been created on that date or earlier).

The following will provide a list of VMs sorted by their creation time.

function Get-VMCreationTimes {
   $vms = get-vm
   $vmevts = @()
   $vmevt = new-object PSObject
   foreach ($vm in $vms) {
      #Progress bar:
      $foundString = "       Found: "+$"   "+$vmevt.createdTime+"   "+$vmevt.IPAddress+"   "+$vmevt.createdBy
      $searchString = "Searching: "+$
      $percentComplete = $vmevts.count / $vms.count * 100
      write-progress -activity $foundString -status $searchString -percentcomplete $percentComplete

      $evt = get-vievent $vm | sort createdTime | select -first 1
      $vmevt = new-object PSObject
      $vmevt | add-member -type NoteProperty -Name createdTime -Value $evt.createdTime
      $vmevt | add-member -type NoteProperty -Name name -Value $
      $vmevt | add-member -type NoteProperty -Name IPAddress -Value $vm.Guest.IPAddress
      $vmevt | add-member -type NoteProperty -Name createdBy -Value $evt.UserName
      #uncomment the following lines to retrieve the datastore(s) that each VM is stored on
      #$datastore = get-datastore -VM $vm
      #$datastore = $vm.HardDisks[0].Filename | sed 's/\[\(.*\)\].*/\1/' #faster than get-datastore
      #$vmevt | add-member -type NoteProperty -Name Datastore -Value $datastore
      $vmevts += $vmevt
      #$vmevt #uncomment this to print out results line by line
   $vmevts | sort createdTime

This can be useful in identifying your oldest VMs. This will give output that looks like this:

createdTime                    name             IPAddress          createdBy
-----------                    ----             ---------          ---------
9/10/2009 10:21:05 PM          vm1              {}          Administrator
11/11/2009 6:00:22 PM          vm6              {}          user1
12/1/2009 5:26:39 PM           vm3              {}                 user2
1/8/2010 12:51:33 PM           vm10             {}          user1
...                            ...              ...                ...

For an alternative script that saves the creation time and user as custom fields on each VM (so it should be faster for repeated runs), see Alan Renouf’s script here: