Pathogens present in the environment pose a serious threat to human, plant and animal health as evidenced by recent outbreaks. As many pathogens can survive and proliferate in the environment, it is important to understand their population dynamics and pathogenic potential in the environment. To assess pathogenic potential in diverse habitats, we developed a functional gene array, the PathoChip, constructed with key virulence genes related to major virulence factors, such as adherence, colonization, motility, invasion, toxin, immune evasion and iron uptake. A total of 3715 best probes were selected from 13 virulence factors, covering 7417 coding sequences from 1397 microbial species (2336 strains). The specificity of the PathoChip was computationally verified, and approximately 98% of the probes provided specificity at or below the species level, proving its excellent capability for the detection of target sequences with high discrimination power. We applied this array to community samples from soil, seawater and human saliva to assess the occurrence of virulence genes in natural environments. Both the abundance and diversity of virulence genes increased in stressed conditions compared with their corresponding controls, indicating a possible increase in abundance of pathogenic bacteria under environmental perturbations such as warming or oil spills. Statistical analyses showed that microbial communities harboring virulence genes were responsive to environmental perturbations, which drove changes in abundance and distribution of virulence genes. The PathoChip provides a useful tool to identify virulence genes in microbial populations, examine the dynamics of virulence genes in response to environmental perturbations and determine the pathogenic potential of microbial communities.