This is a one month update from my posts dated 1-8-16 at 10:48pm & 1-19-16 at 8:12pm. After experiencing identical issues to everyone on this thread, the following parts were replaced by an Apple authorized technician on 1-19-16:
Main logic board
Power supply
Power cord
Hard Drive
After 30 days, everything is working well with no shutdowns or issues, knock on wood.
Now... after reading every single post on this thread since those dated May 2014, I have learned three important factors about this 2012 iMac and the shutdown problems:
1. The issue is NOT the logic board or motherboard. If you only replace the logic board and nothing else, there is a 100% chance that you will be back for more repairs within days or weeks. When technicians make this recommendation (to only replace the logic board), ARGUE WITH THEM! and refer them to this thread. This many people from around the world can't be wrong!
2. It is NOT an overheating issue or "excessive dust in the unit" problem. When my iMac was in the shop with the monitor removed, the technician noted that not a spec of dust was present anywhere in unit... and I own two cats and create as much dust as anyone.
3. It probably IS an issue with the power supply or a component connected to the supply unit. Recently, several people have noted that a bad capacitor could be the culprit... this remains a possibility also.
RECOMMENDATIONS:
1. Don't waste time with Genius Bar test... this proves absolutely nothing when attempting to diagnose the issue.
2. If the shutdown issue "can't be replicated" by an Apple technician, have them connect & re-connect devices to the USB ports in the back of the unit. Also, have them keep the machine powered on for several days and then put it under a stress test. Finally refer the Apple techniians to this thread. A good technician will not "ignore" this many people with the exact same iMac problem when this much evidence is present.
3. Call Apple and report the issues before and after an Apple technician has a look. Just having Apple document your issue with your iMac serial number goes a long way even if you don't have the Apple Warranty. Also, KEEP A DIARY of dates, times, events leading up to the shutdown. I did this in an earlier post and it was very valuable to both Apple technicians at the national database and my local repair people.