Why doesn't my Mac go to sleep when closing the lid or through the task bar when plugged in? I noticed that when I close to lid of my MacBookPro 2008 edition. My computer does not go to sleep. I also observed that this occurs when the Mac is plugged in. When I unplug, everything seems to be working fine. Does it have something to do with Lion? I already tried changing the energy settings in System Preferences.
Oddly Resetting my Sharing preferences did solve my problem. All I did is go into the System Preferences Settings. 
1. Chose Sharing.
2. Uncheck everything that is checked.
3. Close System Preferences.
4. Open Systems preferences back up. 
5. Go back into Sharing
6. Check everything you want checked
7. PROBLEM SOLVED !!! (For me at least) I have a 2008 MacbookPro running Max OS X 10.7.2