After the Peninsula, Cooke left active field service. One proximate reason was the embarrassment he suffered when his son-in-law, J.E.B. Stuart, humiliated the Union cavalry by completely encircling the Army of the Potomac in his celebrated raid. Cooke served on boards of court-martial, commanded the District of Baton Rouge, and was superintendent of Army recruiting for the Adjutant General's office. On July 17, 1866, President Andrew Johnson nominated Cooke for appointment to the brevet grade of major general in the regular army, to rank from March 13, 1865, and the U.S. Senate confirmed the appointment on July 23, 1866.