skip to Main Content

Enable MFA Office 365 with PowerShell

We need to enable MFA for Office 365 users for extra security. What is the fastest and safest way to enable Office 365 MFA? In this article, you will learn how to enable MFA Office 365 for all users and one user with PowerShell.

Introduction

Why do you need to enable MFA Office 365? A couple of reasons are:

  • Secure environment from attacks
  • Move from another MFA vendor

Do you have Azure AD Premium plan 1 or 2? We recommend you configure Azure AD Multi-Factor Authentication instead of per-user MFA (this article).

Before you start

Start Windows PowerShell and connect to Azure AD PowerShell.

Connect-MsolService

Enable MFA Office 365 for single user

Enable MFA for a single Office 365 user.

$mf= New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$mf.RelyingParty = "*"
$mfa = @($mf)

Set-MsolUser -UserPrincipalName "Amanda.Morgan@exoip.com" -StrongAuthenticationRequirements $mfa

Enable MFA Office 365 for all users

Enable MFA for all Office 365 users.

$mf= New-Object -TypeName Microsoft.Online.Administration.StrongAuthenticationRequirement
$mf.RelyingParty = "*"
$mfa = @($mf)

Get-MsolUser -All | Set-MsolUser -StrongAuthenticationRequirements $mfa

Export Office 365 MFA status

Do you like to verify that MFA for the users is successfully enabled? An excellent way is to export Office 365 users MFA status report with PowerShell.

Enable MFA Office 365 with PowerShell

That’s it!

Important: Always use MFA to protect the accounts from attacks and compromised passwords. It adds another layer of protection that helps organizations.

Read more: Disable MFA Office 365 with PowerShell »

Conclusion

You learned how to enable MFA Office 365 with PowerShell. Connect to Azure AD with PowerShell and run the command to enable MFA for all Office 365 users or single user. Don’t forget always to use MFA for extra protection.

Did you enjoy this article? You may also like Move from per-user MFA to Conditional Access MFA. Don’t forget to follow us and share this article.

ALI TAJRAN

ALI TAJRAN

ALI TAJRAN is a passionate IT Architect, IT Consultant, and Microsoft Certified Trainer. He started Information Technology at a very young age, and his goal is to teach and inspire others. Read more »

This Post Has 2 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *