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.