Microgrid operations planning is one of the keys to ensuring the safe and efficient outputs of distributed energy resources (DERs) and the stable operation of a power system in a microgrid (MG). In this study, for the symmetry in renewable energy and microgrid systems, and coordinated control based on a storage battery system, an MG dispatching model with DER conditions and integrated costs is established in grid-connected mode, on the basis of MG operation costs, interaction costs, and pollutant emissions costs. Moreover, an optimization objective for minimizing integrated costs is established. Therefore, based on the original whale optimization algorithm (WOA), an improved whale optimization algorithm (IWOA) with adaptive weight strategy and Levy flight trajectory is proposed in this paper, to solve the optimal operations planning problem of MGs. Finally, in computing comparisons with methods such as the genetic algorithm (GA), particle swarm algorithm (PSO), WOA, wild horse optimizer (WHO), and enhanced whale optimization algorithm (EWOA), the results show that the IWOA computation had lower integrated costs and higher operational efficiency. Moreover, it is verified that the IWOA performed better in solving the MG operations planning problem.