Office 365 – Connecting to PowerShell with MFA


You enable MFA in your organization and now you can’t connect through PowerShell


(h/t me)

Referencing the following doc (


  1. Use Internet Explorer when you download and run the app
  2. Once you download and install the app, open up PowerShell (admin mode) and run winrm /quickconfig and hit YES
  3. All PowerShell commands should be run through the new app Microsoft Exchange Online Powershell Module
  4. When you run Connect-EXOPSSession -UserPrincipalName you’ll get an error, ignore the error
    1. $UserCredential = Get-Credential
    2. Import-Module MSOnline
    3. Connect-MsolService –Credential $UserCredential

This is for the initial setup, subsequently, I’m not sure which steps to go through.