Black scurf caused by Rhizoctonia solani severely affects potato production. Through amplification of V3-V4 and ITS1-5f variable regions of 16S and internal transcribed spacer (ITS) rRNA, the study was based on the location (Kunming, Qujing, and Zhaotong), plant components (rhizosphere soil and roots), and sample types (healthy and diseased) to assess the diversity of bacterial and fungal communities. We found plant components significantly influence microbial diversity, with rhizosphere soil being more diverse than roots, and the microbial community in the root is mainly derived from the rhizosphere soil. Moreover, the rhizosphere soil and roots of healthy potato plants exhibit greater microbial diversity compared to those of potato plants infected by Rhizoctonia solani. Bacterial phyla Actinobacteriota and Acidobacteriota were enriched in rhizosphere soil compared to that of roots, whereas Proteobacteria and Cyanobacteria showed the opposite trend. Fungal phylum Ascomycota was found in low relative abundance in rhizosphere soil than in roots, whereas Basidiomycota showed the opposite trend. Bacterial genera including Streptomyces, Lysobacter, Bacillus, Pseudomonas, Ensifer, Enterobacter, and the Rhizobium group (Allorhizobium, Neorhizobium, Pararhizobium, Rhizobium), along with fungal genera such as Aspergillus, Penicillium, Purpureocillium, and Gibberella moniliformis, have the potential ability of plant growth promotion and disease resistance. However, most fungal species and some bacterial species are pathogenic to potato and could provide a conducive environment for black scurf infection. Interaction within the bacterial network increased in healthy plants, contrasting with the trend in the fungal network. Our findings indicate that R. solani significantly alters potato plant microbial diversity, underscoring the complexity and potential interactions between bacterial and fungal communities for promoting potato plant health and resistance against black scurf.