The following year Mackenzie went to South Africa on the outbreak of the Second Boer War, and from 1900 he served as Director of Intelligence on the staff of the Commander-in-Chief, Lord Roberts. In a despatch dated 31 March 1900, Lord Roberts described how Mackenzie "afforded … material assistance by the accurate and valuable reports he submitted". He was promoted to lieutenant colonel on 29 November 1900. In the later stages of the war, he became Military Governor of Johannesburg. Following the end of hostilities in June 1902, he returned to the United Kingdom in the "SS Dunottar Castle", which arrived at Southampton the following month. For his service in the war, Mackenzie was appointed a Companion of the Order of the Bath (CB) in the April 1901 South Africa Honours list (the award was dated to 29 November 1900), and he received the actual decoration after his return home, from King Edward VII at Buckingham Palace on 24 October 1902.