Microgrids are a way to integrate multiple local generation units, including Renewable Energy Resources, power storage, and load under one entity. The purpose of Microgrid is to increase the penetration of renewable energy, optimize Grid operations, and incorporate communication in a way that allow for the realization of Smart Grids. This concept promises to resolve many of the issues and challenges faced by the increase in the demand of electrical power. In this paper, a Power Management System algorithm in secondary control of a Microgrid is developed and simulated. The algorithm is implemented using Multi-Agent System technology and simulated in both MATLAB/SIMULINK and Java Agent Development Environment environments. The Microgrid is operated in grid-connected mode and consists of 2 distributed generation units (representing a Photo voltaic System and a Wind Turbine), a distributed storage unit, a variable RL load. The simulation for this Microgrid is run and the performance of the algorithm is finally presented.