One of the major problem in the optimal operation of the power system is optimal operation of microgrid with regard to the Demand-side-management. From one side, demand-side-management programs reduce the operating costs of the power system and on the other hand, the implementation of these programs requires a financial incentive policies. In this paper, optimal operation of microgrid with demand-side-management is formulated as an optimization problem. Load shifting is taken into account as an effective tool for demand-side management. The objective function of this problem is consist of the minimization of total operation cost of the power system and the load shifting cost. The constraints of the problem include operational constraints and load shifting constraints. In this problem, the time of load shifting is considered as decesion variables. In order to solve the optimization problem, the combination of genetic algorithm and optimal power flow algorithm has been used. The proposed method is applied to a samples microgrid and the results showed that with the help of demand-side-management, the total cost of utilizing a microgrid can be reduced.