Because I’ve been asked too many times and keep having to look up the commands, I’m just going to throw them here for reference. If your ADFS farm, federated with Office 365, goes down for some reason and is no longer reachable, the Microsoft way of unfederating your Office 365 logon domain won’t work, as the set-msoladfscontext command won’t be able to reach your ADFS machine.
Simply setting the domain’s authentication mode from Federated to Managed will also do the trick and allow your users to login with their synced passwords:
Import-Module MSOnline Connect-MsolService Set-MsolDomainAuthentication -Authentication Managed -DomainName yourlogondomain.com