There are a few script which you could use. this is one for example => https://mymicrosoftexchange.wordpress.com/2015/11/20/office-365-script-to-bulk-change-the-userprinci...

Are your users sync'ed or cloud only users?

If they are sync'ed, you need to do this in AD.
We support Ukraine and condemn war. Push Russian government to act against war. Be brave, vocal and show your support to Ukraine. Follow the latest news HERE