This paper deals with resilient and privacypreserving control to optimize the daily operation costs of networked Battery Energy Storage Systems (BESS) in a multiagent network vulnerable to various types of cyber-attacks. First, we formulate the optimization problem by defining the objective function and the local and coupling constraints. Next, we introduce a novel resilient decentralized control and optimization algorithm that can mitigate the effects of cyber-attacks, specifically false data injection attacks and hijacking, to enhance the network's resilience. The proposed method is based on filtering out outlier Lagrange multipliers in a suitable dual problem. Our proposed algorithm has two main advantages compared to the existing literature. Firstly, it can solve problems where the coupling constraint is not restricted to the average or a function of the average of decision variables. Secondly, our algorithm extends the well-known dual decomposition and Lagrange multiplier method to the decentralized control problem of BESSs. In the proposed algorithm presented in this paper, only the data relevant to the dual problem is exchanged among the agents. Noticing that the data of the dual problem does not contain any private information, mitigating privacy concerns associated with our proposed algorithm. We formally prove the convergence of our algorithm to a feasible and sub-optimal solution. Additionally, simulations demonstrate the effectiveness of our results.Note to Practitioners-Optimal coordinated control of BESSs increases the power system's reliability and reduces costs. With the expansion of the use of small-scale BESSs in household customers, it is possible to considerably increase the free capacity of power networks by optimally controlling these small BESSs.