Strict planetary protection practices are implemented during spacecraft assembly to prevent inadvertent transfer of earth microorganisms to other planetary bodies. Therefore, spacecraft are assembled in cleanrooms, which undergo strict cleaning and decontamination procedures to reduce total microbial bioburden. We wanted to evaluate if these practices selectively favor survival and growth of hardy microorganisms, such as pathogens. Three geographically distinct cleanrooms were sampled during the assembly of three NASA spacecraft: The Lockheed Martin Aeronautics' Multiple Testing Facility during DAWN, the Kennedy Space Center's Payload Hazardous Servicing Facility (KSC-PHSF) during Phoenix, and the Jet Propulsion Laboratory's Spacecraft Assembly Facility during Mars Science Laboratory. Sample sets were collected from the KSC-PHSF cleanroom at three time points: before arrival of the Phoenix spacecraft, during the assembly and testing of the Phoenix spacecraft, and after removal of the spacecraft from the KSC-PHSF facility. All samples were subjected to metagenomic shotgun sequencing on an Illumina HiSeq 2500 platform. Strict decontamination procedures had a greater impact on microbial communities than sampling location Samples collected during spacecraft assembly were dominated by Acinetobacter spp. We found pathogens and potential virulence factors, which determine pathogenicity in all the samples tested during this study. Though the relative abundance of pathogens was lowest during the Phoenix assembly, potential virulence factors were higher during assembly compared to before and after assembly, indicating a survival advantage. Decreased phylogenetic and pathogenic diversity indicates that decontamination and preventative measures were effective against the majority of microorganisms and well implemented, however, pathogen abundance still increased over time. Four potential pathogens, Acinetobacter baumannii, Acinetobacter lwoffii, Escherichia coli and Legionella pneumophila, and their corresponding virulence factors were present in all cleanroom samples. This is the first functional metagenomics study describing presence of pathogens and their corresponding virulence factors in cleanroom environments. The results of this study should be considered for microbial monitoring of enclosed environments such as schools, homes, hospitals and more isolated habitation such the International Space Station and future manned missions to Mars.