Aims The relationship between dioecious plants and soil rhizosphere microorganisms remains unclear, particularly in diverse sandy environments where sex dimorphism is observed.Methods The study extensively investigated the microbial communities associated with male and female Salix gordejevii, which are widely utilized for wind deterrence and sand fixation in the arid and semi-arid regions of Inner Mongolia's middle-east area. Illumina sequencing was employed to examine the fungal and bacterial communities in the rhizospheres of male and female S. gordejevii plants across mobile, semi-arid, and fixed sandy sites.Results It was found that the bacterial community composition was largely affected by the sandy land types. The fungal community composition, however, was influenced by both the plant sexes and the site conditions. In the moving sandy site, diversity of fungi and bacteria in the rhizosphere of S. gordejevii was lower than that in the fixed sandy site. The assembly of the bacterial community in the rhizosphere of S. gordejevii was regulated by soil properties, with pH being identified as the most influential factor impacting bacterial diversity and richness.Conclusion The sharing of these core microbes among the samples implies the rhizospheres of S. gordejevii in different sandy sites exhibited a shared core community of fungi and bacteria, known for their ability to enhance plant growth and confer resistance against abiotic stress. These findings will not only unveil the impact of sexual dimorphism in S. gordejevii on microbial assemblages, but also contribute to the restoration of microbial diversity in degraded ecosystems.