Preterm infants with very low birthweight are at serious risk for necrotizing enterocolitis. To functionally analyse the principles of three successful preventive NEC regimens, we characterize fecal samples of 55 infants (less than 1500 g, n = 383, female = 22) longitudinally (two weeks) with respect to gut microbiome profiles (bacteria, archaea, fungi, viruses; targeted 16S rRNA gene sequencing and shotgun metagenomics), microbial function, virulence factors, antibiotic resistances and metabolic profiles, including human milk oligosaccharides (HMOs) and short-chain fatty acids (German Registry of Clinical Trials, No.: DRKS00009290). Regimens including probiotic Bifidobacterium longum subsp. infantis NCDO 2203 supplementation affect microbiome development globally, pointing toward the genomic potential to convert HMOs. Engraftment of NCDO 2203 is associated with a substantial reduction of microbiome-associated antibiotic resistance as compared to regimens using probiotic Lactobacillus rhamnosus LCR 35 or no supplementation. Crucially, the beneficial effects of Bifidobacterium longum subsp. infantis NCDO 2203 supplementation depends on simultaneous feeding with HMOs. We demonstrate that preventive regimens have the highest impact on development and maturation of the gastrointestinal microbiome, enabling the establishment of a resilient microbial ecosystem that reduces pathogenic threats in at-risk preterm infants.