Using MFA to connect to Exchange Online PowerShell

MFA is a security requirement, especially when managing your environment in the cloud. Microsoft Azure offers free multifactor authentication for Office 365 administrator accounts and if you don’t have one yet, please make sure that all your administrator accounts are using MFA. When managing Exchange Online in Office 365, my favorite method is using Exchange Online PowerShell. But if you use Microsoft step-by-step to connect using a regular PowerShell application, it does work if you are not using MFA (not good!).

So, let’s cover the basic steps to allow an administrator to use Exchange Online PowerShell with MFA. The first step is logged on the Exchange Admin Center, click on Hybrid, and then click on the second Configure button, which is related to Exchange Online PowerShell module.

Exchange Online PowerShell

You will be requested to Install the module, and after that, you will need to confirm the process by clicking on Run in a second dialog box that will pop up. The result of this process will be a new item in your Start button called Microsoft Exchange Online PowerShell click on it.

Exchange Online PowerShell

In the new PowerShell window, we can use the following cmdlet to connect: Connect-EXOPSSession –UserPrincipalName <username>, as depicted in the image below.

At this time, I hope you have already configured MFA to your administrator, and if you have done that, then the MFA will be requested in the new dialog box.

That’s it! By using this method you can take advantage of MFA to increase your security to authenticate in Office 365 to manage your Exchange environment!

Featured image: Shutterstock

About The Author

1 thought on “Using MFA to connect to Exchange Online PowerShell”

  1. Hi Anderson,
    thank you for your post about login to EXO with MFA.
    Can you explain me, how i can login to EXO with powershell with MFA on my account, when I am Partner admin, and i need login to EXO to our customer´s tenant, withou account in customer tenant ?

    Many thanks

    Petr

Leave a Comment

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Scroll to Top