Chosen Solution

I have a 2007 (MId year) 20" imac. It started to shut off after 15 minutes, now it wont turn on? Is this the logic board? At one time, the diagnostics said hard drive okay, but something else causing it to just turn off/stop. It tried to restart but just displayed the apple logo without starting up.

Most likely is that your power supply has failed: iMac Intel 20" EMC 2133 and 2210 Power Supply Replacement