Energy efficiency is a major concern to datacenter operators, because the large amounts of energy used by parallel computing infrastructures increases costs and affects the electricity grid. Datacenter power consumption can be reduced by applying intelligent control techniques to dynamically adjust power demand, but this is hampered by conflicting objectives. For instance, the workload can be controlled to adjust power, but at the expense of service quality. Or, the cooling infrastructure demand can be manipulated without affecting workloads, but at the risk of shifting the datacenter temperature outside the acceptable limits. This paper proposes a multiobjective, evolutionary approach to solving the problem of energy-aware task scheduling in datacenters. Our approach takes into account three problem objectives (power consumption, temperature, and quality of service) when both computing and cooling infrastructures are holistically controlled. We report the two best solutions to each of these problem objectives, as well as the selected trade-off solutions between them.