From April 4, 1864 to July 25, 1866, Porter was aide-de-camp to General Ulysses S. Grant with the grade of lieutenant colonel in the regular army. On July 17, 1866, President Andrew Johnson nominated Porter for appointment as brevet brigadier general, to rank from March 13, 1866, and the U.S. Senate confirmed the appointment on July 23, 1866. From July 25, 1866 to March 4, 1869, Porter was aide-de-camp to General Ulysses S. Grant with the grade of colonel in the regular army.