MFA - Enable via Powershell

Steel Contributor

_____________________________

 

existing script:

 

$auth.RelyingParty = "*"

$auth.State = "Enforced"

$auth.RememberDevicesNotIssuedBefore = (Get-Date)


Import-Csv C:\CSV\MFA_Enabled.csv | Get-MsolUser | Foreach{ Set-MsolUser -UserPrincipalName $_.UserPrincipalName -StrongAuthenticationRequirements $auth}

 

------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

if we use “Enable” in the $auth.State, can this script be enhanced  to include checkpoint/verification if the current state is already “Enforced” then provide prompt or even skip that particular user?

0 Replies