 As chief of artillery under Maj. Gen. George B. McClellan, Barry organized ordnance for the Army of the Potomac and, during the Peninsula Campaign, later took part in the battles of Yorktown, Mechanicsville, Gaines' Mill, White Oak Swamp, and Malvern Hill.After later supervising forts and ordnance surrounding Washington, D.C., Barry became chief of artillery under Maj. Gen. William T. Sherman, serving with him in Tennessee, the March to the Sea, and the Carolinas Campaign.On January 23, 1865, President Lincoln nominated Barry for appointment to the brevet grade of major general of volunteers, to rank from September 1, 1864, for his service in the Atlanta Campaign, and the U.S. Senate confirmed the appointment on February 14, 1865.