Although the afforestation of former arable lands is a common global land-use conversion, its impact on soil microbial communities at the aggregate scale has not been adequately addressed. In this study, soil samples were categorized into large macroaggregates (LM, >2 mm), small macroaggregates (SM, 2–0.25 mm), and microaggregates (MI, <0.25 mm) to assess the changes in microbial composition, diversity, network complexity, and network stability within soil aggregates after the afforestation of a former dryland in northwestern China. The results revealed that afforestation enhanced the relative abundance of Actinobacteriota, Chloroflexi, Ascomycota, and Mortierellomycota within the soil aggregates, suggesting that these phyla may have greater advantages in microbial communities post-afforestation. The Shannon–Wiener and Pielou indices for bacterial communities showed no significant differences between land-use types across all aggregate fractions. However, the alpha diversity of fungal communities within the LM and SM significantly increased after afforestation. Bray–Curtis dissimilarity indices showed that afforestation altered bacterial beta diversity within the LM and MI but had a minimal impact on fungal beta diversity across all three aggregate fractions. The topological features of cross-kingdom microbial co-occurrence networks within the soil aggregates generally exhibited a decreasing trend post-afforestation, indicating a simplification of microbial community structure. The reduced robustness of microbial networks within the LM and SM fractions implies that afforestation also destabilized the structure of microbial communities within the macroaggregates. The composition of the soil microbial communities correlated closely with soil carbon and nitrogen contents, especially within the two macroaggregate fractions. The linkages suggests that improved resource conditions could be a key driver behind the shifts in microbial communities within soil aggregates following afforestation. Our findings indicate that the impact of afforestation on soil microbial ecology can be better understood by soil aggregate fractionation.