I, too, have been plagued by the unexpected, random shutdowns I've experienced since July 2013 (after my computer was opened up for repairs). I have a 27" iMac, late 2010, 2.93 ghz i7 quad, 16 gb ram, on 10.6.8.
I had no problems with the computer, which is basically an image workstation, until July 2013 when I noticed slowing performance. I took it to the Apple store in Houston, and they diagnosed it as bad logic board, which had fried 1/2 of my ram. I had the board replaced, and a few weeks later, the shutdowns started. At first, they were spaced apart far enough that I wasn't losing much work. Later, they were more frequent and frustrating, so I took the iMac back to Apple and left it there for 3 days for diagnostics. I was told that the hard disk was showing errors, so I had that replaced at my expense. Apple also replaced the logic board again at their expense. Same result - a few weeks later, the shutdowns began again. Normally, these occur when the computer is awake, and I normally have LightRoom and Photoshop open, and Safari. Sometimes a lot of data is being crunched, and other times the unit is not under demanding processes.
I avoided taking the unit back to Apple during the holiday madness, so I went back in January 2014. One of the geniuses thoroughly went over my use of the computer as he ran tests. We looked at the Console, and he had some suspicions about connected peripherals, especially my Wacom tablet. Apple agreed to replace the video card, and I picked up the unit about 10 days ago.
I unplugged the Wacom after the last repair, and had a shutdown on 1/31. I reloaded the latest Wacom driver, but had a shutdown 02/08, and it still was unplugged. I unplugged all USB items except my mouse, and had a shutdown 02/09. Only my Burly tower with external drives is connected by FW800. A older Cinema 23" is connected for my palette monitor.
I've checked the power cord, and other items plugged into the UPS do not falter when the iMac shuts down.
If my understanding is correct, if it were to be a power supply problem, I could not re-boot after a shutdown. I can re-boot immediately.
I've lost so much productive time with this iMac and the time and money lost while it is at the Apple store.