Background: Parenteral nutrition (PN) is a lifesaving therapy but is associated with gut atrophy and cholestasis. While bile acids (BAs) can modulate intestinal growth via gut receptors, the gut microbiome likely influences gut proliferation and inflammation. BAs also regulate the bile salt export pump (BSEP) involved in cholestasis. We hypothesized that the BA receptor agonist oleanolic acid (OA) regulates gut TGR5 receptor and modulates gut microbiota to prevent PN-associated injury. Materials and Methods: Neonatal piglets were randomized to approximately 2 weeks of isocaloric enteral nutrition (EN), PN, or PN + enteral OA. Serum alanine aminotransferase, bilirubin, BAs, hepatic BSEP, gut TGR5, gut, liver morphology, and fecal microbiome utilizing 16S rRNA sequencing were evaluated. Kruskal-Wallis test, pairwise Mann-Whitney U test, and multilevel logistic regression analysis were performed. Results: PN support resulted in gut atrophy substantially prevented by OA. The median (interquartile range) for villous/crypt ratio was as follows: EN, 3.37 (2.82–3.80); PN, 1.73 (1.54–2.27); and OA, 2.89 (2.17–3.34; P = .006). Pairwise comparisons yielded P = .002 (EN vs PN), P = .180 (EN vs OA), P = .026 (PN vs OA). OA upregulated TGR5 and BSEP without significant improvement in serum bilirubin (P = .095). A decreased microbial diversity and shift toward proinflammatory phylum Bacteroidetes were seen with PN, which was prevented by OA. Conclusions: OA prevented PN-associated gut mucosal injury, Bacterioides expansion, and the decreased microbial diversity noted with PN. This study demonstrates a novel relationship among PN-associated gut dysfunction, BA treatment, and gut microbial changes.