Dormitory washbasins can breed microorganisms that produce odorous gases, polluting the indoor environment. We utilized metagenome sequencing to analyze the microbiota of 40 samples from the drain pipes of dormitory washbasins. Our study aimed to investigate the microbial community structure, antibiotic resistance genes, and virulence factors, and to identify potential influencing factors such as gender, hometown, frequency of hand sanitizer usage, and number of dormitory residents. The analysis revealed 12 phyla and 147 genera, with Proteobacteria and Actinobacteria being the dominant phyla, and Mycobacterium and Nakamurella being the dominant genera. We found that the factors influencing the microbial community structure of the dormitory washbasin drain pipe are complex. The investigated factors have a slight influence on the drain pipe microbial community, with gender exerting a discernible influence. The annotation results revealed the presence of various virulence factors, pathogenic toxins and antibiotic resistance genes, including 246 different toxin types and 30 different types of antibiotic resistance genes. In contrast to the observed differences in microbial composition among samples, the distribution of resistance genes shows relatively small changes among samples. Antibiotics should be a contributing factor in the overall increase of antibiotic resistance genes in drain pipes. Overall, our study provides important insights into the community structure and function of microorganisms in dormitory drainage systems, and can guide efforts to prevent and control microbial pollution.