On 9 August 1799 Ilya Alekseyev was elevated to the rank of colonel and soon after, he served as head of the Moscow police. After the transformation of Squadrons Moscow Police in Regiment Hussars Mitau, he was appointed the commander and took part in various battles on Prussian soil. He showed great bravery in the battles of Eylau, Guttstadt, the Heilsberg and Friedland. As a reward for his courage in battle on 24 May 1809, he was promoted to Major General.