In the First World War Shandruk was the commander of the IIIrd Battalion of the 232nd Reserve Infantry Regiment of the Russian Imperial Army. With the outbreak of the Russian Revolution he joined the Ukrainian National Republic in its struggle against both White and Red Russian forces. He was successively in command of the Zaporozhian Independent Rifle Battalion, the 9th Infantry Regiment and the 1st Recruit Regiment of the Ukrainian National Republic forces. After the reorganization of the army in 1920, he led the 4th Brigade of the 3rd Infantry Division. After the failed Kiev Offensive and the subsequent collapse of the Ukrainian National republic, he was interned in Kalisz, Poland together with the remaining Ukrainian soldiers. He testified for Symon Petliura at Schwartzbard trial along with Mykola Shapoval, and Oleksandr Shulhin.