Grazing and litter removal can alter understory structure and composition after afforestation, posing a serious threat to sustainable forest development. Enclosure is considered to be an effective measure to restore degraded forest restoration. However, little is known about the dynamics of soil nutrients and microbial communities during the forest restoration process. In the present study, the effects of Arachis hypogaea (AH), Pinus sylvestris var. mongolica (PSM), and Pinus sylvestris var. mongolica with enclosure (PSME) on soil chemical properties and soil microbial communities were studied in Zhanggutai, Liaoning Province, China. The results showed that PSME could remarkably contribute to improve soil total C, total N, and total P compared to PSM and AH. Additionally, PSM could clearly increase the soil bacterial community diversity and fungal Chao1 index and ACE index. Additionally, PSME could further increase soil Chao1 index and ACE index of soil bacteria. Soil total C, total N and available N were the main factors related to soil microbial diversity. Actinobacteria and Ascomycota were the predominant bacterial and fungal phyla, respectively. Specifically, PSME could increase the relative abundances of Actinobacteria, Gemmatimonadetes, Ascomycota and Mortierellomycota and decreased the relative abundances of Acidobacteria, Chloroflexi and Basidiomycota than PSM. PSM and PSME could clearly change soil microbial communities compared with AH, and PSME could remarkably shift soil fungal communities than PSM. What's more, the soil microbial community structure were affected by multiple edaphic chemical parameters. It can be seen that afforestation combined with enclosed management potentially regulate microbial properties through shifting the soil properties. This study can provide new ideas for further understanding the impact of enclosure on Pinus sylvestris var. Mongolica and provide theoretical support for the management of Pinus sylvestris var. Mongolica.