He was commissioned an ensign in the Grenadier Guards on 1 February 1814, and fought with that regiment at Quatre Bras and Waterloo. He was also present at the capture of Péronne, and soon after was appointed aide-de-camp to General Sir John Lambert. He later became ADC to the Duke of Wellington, and served on his staff until the end of the occupation of France.
The Duke made him his private secretary upon being appointed Master-General of the Ordnance in 1819, and he continued to serve in this capacity when Wellington was made commander-in-chief (1827), prime minister (1828), foreign secretary (1834), and commander-in-chief again (1842).