I am using Virtual Machine Manager 2008 R2 and wondered if any one of you are aware how I would have the ability to look for virtual machines by running time.

I must discover the machines which have been ready to go a long, to ensure that I'm able to undergo and reboot any which have been up for more than 6 several weeks.

Possibly using powershell this can be done? Everything from inside the GUI could be better still!

Thanks ahead of time!

UPDATE: Just found a much better, and shorter, way:

Get-VM | Where-Object { (Get-VMPerformance -VM $_.Name).UpTime.Days -gt 180 } | Select-Object Name

You will get the data from each VM with WMI. This provides you with all VMs running a lot more than 6 several weeks with no reboot:

$LastBootUpTime = (Get-Date).AddMonths(-6)

Get-VM | Where-Object { Test-Connection -ComputerName $_.Name -Count 1 -Quiet} | Foreach-Object{

    $os = Get-WmiObject Win32_OperatingSystem -ComputerName $_.Name

    if( $os.ConvertToDateTime($os.LastBootUpTime) -lt $LastBootUpTime) { $_ }

} | Select-Object Name