How to connect Powershell to Office 365 after enabling Multi-Factor Authentication?

If a Global Admin wants to use multi-factor authentication (MFA) to connect to Exchange Online PowerShell, you can’t use the instructions at Connect to Exchange Online PowerShell. MFA requires you to install the Exchange Online Remote PowerShell Module, and use the Connect-EXOPSSession cmdlet to connect.
From a long time, an Office 365 Global Admin’s favorite tool is Powershell. He can automate, perform numerous tasks which are not possible via GUI. As from our last blog we came to know that a verification code is sent to User’s Mobile after MFA is enabled.

Question in mind! 

Why can’t we use the same instructions given in Connect to Exchange Online PowerShell for MFA enabled user?  
Let me explain you. When an MFA enabled User tries to connect Powershell, it cannot prompt you to enter the Security Code. Hence, Microsoft provided the separate option to download Exchange Online Remote PowerShell Module from Exchange Admin Center & use it to perform all Powershell tasks.

Practical: (Takes maximum 30 seconds to perform all steps):

a) Open portal.office.com in Internet Explorer & login with the Global Admin or User (Do not use Google Chrome or Mozilla Firefox).

b) Click Admin Center Exchange.

c) A new page will open. Click Hybrid at the bottom left of the page.

Note: You require .NET framework 4.6.2 for Exchange Online Remote PowerShell Module to install. Don’t forget to restart the pc after installation.

d) Click Configure to download Exchange Online Remote PowerShell Module for multi-factor authentication.

Once installation will be completed, a black color Powershell Window will appear automatically.

e) Final Step – Run the Powershell Command:
Connect-EXOPSSession      

(Enter the Global Admin Credentials).


Now Global Admin will be able to connect to Office 365 using Exchange Online Remote PowerShell Module & will be able to perform all the tasks.

MFA provides extra security to any account in the cloud. Hence most organizations take advantage of this feature so that their user’s credentials should never get compromised and important data would be kept safe in the cloud.

I thank you by heart for reading my above blog. In case something is missing or not clear, kindly post it in the comment and I will try to respond asap.

Ajey Kumar Gupta
(Microsoft Engineer)

Next Blog: DNS – How Google connects to its Server?

Subscribe Us

Total Page Visits: 4658 - Today Page Visits: 6

Add a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.