Disable MFA for single user
##This is to enable multi factor authentication for a single Office 365 account.
##Connect to MSOnline.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;
Install-PackageProvider -Name NuGet -Force;
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name MSOnline;
Connect-MsolService;
$email = read-Host 'Email address need to Disable MFA'
Get-MsolUser -UserPrincipalName $email | Set-MsolUser -StrongAuthenticationRequirements @()
##End.
Disable MFA for all users
##Connect to MSOnline.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope LocalMachine -Force;
Install-PackageProvider -Name NuGet -Force;
Set-PSRepository -Name "PSGallery" -InstallationPolicy Trusted;
Install-Module -Name MSOnline;
Connect-MsolService;
##Disable MFA
Get-MsolUser -All | Set-MsolUser -StrongAuthenticationRequirements @()
##End.
5/5 - (1 vote)