In bacteria, outer membrane proteins are essential for nutrient import, signaling, motility and survival. The beta-barrel assembly machinery (BAM) complex is responsible for the biogenesis of beta-barrel membrane proteins, which represent the vast majority of bacterial outer membrane proteins. We solved the structure of the component parts of the BAM complex to determine how it functions. We also discovered a new translocation and assembly module of the machinery (the TAM) which is required for the assembly of many virulence factors in the outer membranes of bacterial pathogens; its structure revealed the way in which it functions together with the core BAM complex. But it has been clear that key virulence factors: such as the type III and type II secretion systems and the capsule secretion system have outer membrane protein portals that are not of beta-barrel architecture. New assays to measure the assembly of these secretion systems demonstrate that a distinct and novel machinery is responsible for their assembly and function in pathogenesis.