Microsoft 365 MFA activeren

Bij een uitrol van multifactor authenticatie wil je voordat je het af gaat dwingen, de optie mogelijk maken. Dit doe je eenvoudig met powershell.

Install-Module 
MSOnline Import-Module 
MSOnline Connect-MSOLService 

Voor een enkele gebruiker gebruik je:

$mf= New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$mf.RelyingParty = "*"
$mfa = @($mf)
Set-MsolUser -UserPrincipalName "d.gilmour@susse.net" -StrongAuthenticationRequirements $mfa

Voor alle gebruikers gebruik je de volgende code:

$mf= New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$mf.RelyingParty = "*"
$mfa = @($mf)
Get-MsolUser -All | Set-MsolUser -StrongAuthenticationRequirements $mfa 

Wil je dit weer uitschakelen:

Get-MsolUser -All | Set-MsolUser -StrongAuthenticationRequirements @()