The paper raises the issue of controlling rural low voltage microgrids in an optimal manner. The impact of different criterion functions, related to the amount of energy exchanged with the distribution system operator network, the level of active power losses, the amount of energy generated by different energy sources and the value of financial performance measures regarding the microgrid operation, on the choice of operating points for devices suggested by the optimization algorithm has been analyzed. Both island and synchronous microgrid operation modes are being considered. We propose two variants of the optimization procedure: the first one is based on the particle swarm optimization algorithm and centralized control logic, and the second one takes advantage of the decentralized approach and Monte Carlo methods. A comparison of the simulation results for two sample rural microgrids, obtained for different objective functions, microgrid operation modes and optimization procedure variants, with the use of prepared algorithm implementations, has been provided. The results show that the proper choice of an objective function can have a crucial impact on the optimization algorithm’s behavior, the choice of operating points and, as a consequence, on microgrid behavior as well. The choice of the proper form of the objective function is the responsibility of the person in charge of both the microgrid itself and its operation. This paper can contribute towards making correct decisions in this area. Generally, slightly better results have been achieved for the centralized control mode of operation. Nevertheless, the results also suggest that in many cases the approach based on distributed logic can return results that are better or sufficiently close to the ones provided by the centralized and more sophisticated approach.