Offfice 365

Enable modern authentication in Exchange Online:
Set-OrganizationConfig -OAuth2ClientProfileEnabled $true
Disable modern authentication in Exchange Online:
Set-OrganizationConfig -OAuth2ClientProfileEnabled $false
To verify that the change was successful, run this command:
Get-OrganizationConfig | Format-Table -Auto Name,OAuth*