This paper describes the economically optimal adoption and operation of distributed energy resources (DER) by a hypothetical California microgrid consisting of a group of commercial buildings over an historic test year, 1999. The optimization is conducted using a customer adoption model (DER-CAM) developed at Berkeley Lab and implemented in the General Algebraic Modeling System (GAMS). A microgrid is a semiautonomous grouping of electricity and heat loads interconnected to the existing utility grid (macrogrid) but able to island from it. The microgrid minimizes the cost of meeting its energy requirements (consisting of both electricity and heat loads) by optimizing the installation and operation of DER technologies while purchasing residual energy from the local combined natural gas and electricity utility. The available DER technologies are small-scale generators (< 500 kW), such as reciprocating engines, microturbines, and fuel cells, with or without combined heat and power (CHP) equipment, such as water and space heating and/or absorption cooling. By introducing a tax on carbon emissions, it is shown that if the microgrid is allowed to install CHP-enabled DER technologies, its carbon emissions are mitigated more than without CHP, demonstrating the potential benefits of small-scale CHP technology for climate change mitigation. Reciprocating engines with heat recovery and/or absorption cooling tend to be attractive technologies for the mild southern California climate, but the carbon mitigation tends to be modest compared to purchasing utility electricity because of the predominance of relatively clean central station generation in California.