following the outbreak of first world war in 1914, ogilvie was appointed as a scientific advisor to the munitions invention department of the ministry of munitions. in 1916, however, he assumed duties as assistant controller in that ministry's trench warfare research department, being formally appointed to do duty as a temporary major in the army (graded for purposes of pay as an assistant director at the war office), with effect from 1 july 1916. in 1917 he was re-deployed as assistant controller in the chemical warfare department. he relinquished his army commission on ceasing to be employed on military duties, and was granted the honorary rank of major, with effect from 22 july 1918.