Penetration of Plug-in Electric Vehicles (PEVs) parking lots into distribution systems and microgrids offers useful decision tools for improving energy management and operations of power systems. In this paper, with an objective to minimize the operation cost while subject to the system, unit and security constraints, a microgrid energy management scheme is proposed, by taking into account PEVs throughout the grid as distributed storage responsive to the nodal prices. The presented method comprises the ex-ante optimal dispatch to minimize the anticipated operation cost, followed by a near real-time dispatch to manage the violation of security constraints regarding any congestion and voltage limit in the microgrid. The second dispatch, as recourse to the ex-ante dispatch, aims to minimize the operation cost and the deviation from the ex-ante dispatch decisions, while any possible binding constraint occurred in the ex-ante dispatch is mitigated. Simulation results on a test microgrid system demonstrate that the presented scheme can effectively ensure secure and economic operations of the microgrid as well as the risk reduction of the ex-ante decisions.