 In 1817 he accompanied his sister to Saint Petersburg when she married Emperor Nicholas I of Russia.In 1816, William became the commander of the "Stettiner Gardelandwehrbataillon" and in 1818 was promoted to "Generalmajor".The next year, William was appointed inspector of the VII.