is your account in user principal name format (for example, When you use the ExchangeEnvironmentName parameter, you don't need use the ConnectionUri or AzureADAuthorizationEndPointUrl parameters.The command that you need to run uses the following syntax: Connect-ExchangeOnline -UserPrincipalName You might be able to skip this step and run Connect-ExchangeOnline without loading the module first.If you've already installed the EXO V2 module, the previous command will work as written.In a PowerShell window, load the EXO V2 module by running the following command: Import-Module ExchangeOnlineManagement These connection instructions use modern authentication and work with or without multi-factor authentication (MFA).įor other sign in methods that are available in PowerShell 7, see the PowerShell 7 log in experiences section later in this topic. Connect to Exchange Online PowerShell using modern authentication with or without MFA Having problems? Ask in the Exchange Online forum.
The requirements for installing and using the EXO V2 module are described in Install and maintain the EXO V2 module. What do you need to know before you begin? Note that this older version of the module will eventually be retired. To use the older Exchange Online Remote PowerShell Module to connect to Exchange Online PowerShell using MFA, see V1 module - Connect to Exchange Online PowerShell using MFA. To use the older, less secure remote PowerShell connection instructions that will eventually be deprecated, see Basic auth - Connect to Exchange Online PowerShell.
This article contains instructions for how to connect to Exchange Online PowerShell using the EXO V2 module with or without MFA. For more information about the EXO V2 module, see About the Exchange Online PowerShell V2 module. The Exchange Online PowerShell V2 module (abbreviated as the EXO V2 module) uses modern authentication and works with multi-factor authentication (MFA) for connecting to all Exchange-related PowerShell environments in Microsoft 365: Exchange Online PowerShell, Security & Compliance PowerShell, and standalone Exchange Online Protection (EOP) PowerShell.