With the increase in renewable energy integration in the electrical power systems along with increase in the time-varying energy consumption by the users, it is imperative to regulate the load profile through pragmatic economical Demand-Side Management. Thus, the study carried out in this paper presents a real-time algorithm for cost optimization to achieve Demand-Side Management of a Renewable Energy Source integrated microgrid. The algorithm aims to achieve utility maximization and cost reduction for an optimal power scheduling in the presence of variable loads. The proposed approach mitigates the continuous changes in the variable loads that emulates the load profile found in residential, commercial and industrial users. The particular focus of this work is on developing a decentralized control scheme and a utility-oriented energy community, which provides user satisfaction based on energy management system, production units and load demand. Moreover, the paper presents utility maximization solutions on the combined energy profile of the microgrid targeting two main objectives, i.e., (1) minimizing the aggregate energy cost and (2) maximizing the provider's and user's satisfaction. Minimizing the aggregate energy cost aims to reduce the peak to average ratio of the aggregate energy profile of the microgrid using the cost function for energy cost minimization. The proposed technique is tested on microgrid which is coordinated in master-slave control topology. The implemented algorithm ensures a stable and efficient operation of the microgrid while minimizing the total cost of production.