In the paper different strategies are presented which are able to manage the operation of a microgrid characterized by the presence of datacenters, electric vehicles and distributed generation. Datacenters are considered to use the batteries within the uninterruptible power sources for providing active power support. The electric vehicles are considered to control their charge in the most convenient way. Distributed generation units are considered to maximize the use of renewable energy within the grid operation constraints. Also the reactive power support of all the resources is considered. Based on single-objective formulations, the proposed strategies allow to operate these resources in order to gain some services such as cost minimization, power quality or energy savings. Several numerical applications are made and the results demonstrate the effectiveness of each single-objective strategy.