In case of abnormal conditions, distribution systems should be reconfigured to overcome the impacts of outages such as overloads of network components and increased power losses. For this purpose, energy storage systems (ESS) and renewable energy sources (RES) can be applied to improve operating conditions. An optimal contingency assessment model using two-stage stochastic linear programming including wind power generation and a generic ESS is presented. The optimization model is applied to find the best radial topology by determining the best switching sequence to solve contingencies. The proposed model is applied to a 69-node distribution system and the results of all possible contingencies in the network are examined considering three different case studies with several scenarios. In addition, a reconfiguration analysis including all the contingencies is presented for the case studies.