After most of Poland was occupied by the Central Powers in 1915, the PMO became semi-legal and unofficially supported by the German army, which saw it as a useful source of information on Russia and a useful reservoir of skilled officers. However, in July 1917, after the Oath Crisis in the Polish Legions and the arrest of Piłsudski, the PMO returned to the underground and started covert operations against German and Austrian garrisons and supply lines. In place of Piłsudski, who was sent to a German prison in the fortress in Magdeburg, the commander of the PMO became his friend, Edward Rydz-Śmigły, also future Marshal of Poland.