Connect to Exchange Online PowerShell using MFA

Copper Contributor
Hello ,
I am not able to connect to exchange online powershell.could you please help on this.
4 Replies

What version of Windows ?

What is the Error Code ?

SSO/Seamless Sign on enabled in Azure AD or a federated environment ?
Do you have the necessary permissions to connect to EXO PS ?

If any conditional access enabled in your org via Azure AD ?

Any firewall or network prohibiting connection ?

Necessary ports open over Network for connection unblock towards EXO Public Ip's ?

Have you tried using EXO PowerShell from via Hybrid Tab ?


Please share error code or screenshot 



Ankit Shukla


Usually caused from using old Exchange Online Powershell. If you use later version and use connect-exosession it should use MFA no problem. As Ankit said, please provide more details. Thanks.


 I hope this might help you

Connect Exchange Online PowerShell using MFA


This blog explains following things:

  • How to install Exchange Online PowerShell Module for MFA
  • How to connect Exchange Online PowerShell using MFA
  • Trouble shooting tips to connect Exchange Online PowerShell using MFA




If you want to use multi-factor authentication (MFA) to connect to Exchange Online PowerShell, you can't use the instructions at Connect to Exchange Online PowerShell to use remote PowerShell to connect to Exchange Online.

  • First, MFA requires you to install the Exchange Online Remote PowerShell Module
  • Then you need to use the Connect-EXOPSSession cmdlet to connect

Ok, lets see how it works…

  • Open the Exchange Online Remote PowerShell Module ( Microsoft Corporation > Microsoft Exchange Online Remote PowerShell Module).
  • Run the command, Connect-EXOPSSession –UserPrincipalName deva @ contoso. onmicrosoft. com

  • This throws the credentials prompt, so provide the password.
  • A verification code is generated, sent.
  • Provide the verification code in Verification window
  • After Step 4, the Exchange Online cmdlets are imported into your Exchange Online Remote PowerShell Module session and tracked by a progress bar.
  • If you don't receive any errors, you connected successfully.
  • Just to check that, run any of the Exchange cmdlet and see the results.


  • Once you’re done and want to disconnect all currently open PowerShell sessions in the current window, run the following command: Get-PSSession | Remove-PSSession


Hope this helps.