Desertification has been increasingly influenced by excessive human activities in recent years, leading to continuous desert expansion into adjacent grasslands. To examine the effects of restoration on soil microbial communities by focusing on the relationship between vegetation and soil, we used high-throughput sequencing technology to investigate the variation in 0--20 cm soil bacterial and fungal community structure and diversity across restored areas from 9a to 15a, considering different slope positions in the Hulunbuir sandy grassland. The results revealed that as the number of years of restoration increased, improvements in soil properties and increases in the abundance of eutrophic bacteria, along with decreases in the abundances of oligotrophic bacteria and fungi, were observed. The abundance of the soil bacterial communities increased, whereas the diversity and evenness remained unchanged, and the alpha diversity of the soil fungal communities decreased accordingly. The soil bacterial community was more sensitive than the soil fungal community in the study area, driven mainly by the soil moisture content, soil organic matter, and vegetation-related factors, while there was no significant correlation between the soil fungal community structure and environmental factors. These results indicate that the restoration process involving revegetated shrubs by plants in the Hulunbuir sandy land is similar to the process of shrub encroachment. Further sustainable measures should be explored in more comprehensive multidisciplinary studies for restoring the Hulunbuir sandy grassland.