Connect Powershell to Exchange Online

article #804, updated 310 days ago

There are different methods for 365/Azure. But to get directly to Exchange Online from Powershell running on Windows, a current update of longstanding methods is as follows.

To install the module:

Set-Executionpolicy RemoteSigned -Scope Process
Install-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement

To update the module:

Set-Executionpolicy RemoteSigned -Scope Process
Update-Module -Name ExchangeOnlineManagement
Import-Module ExchangeOnlineManagement

To connect:

Connect-ExchangeOnline -UserPrincipalName admin@domain.com

Current reference, including methods for MacOS and Linux as well:

learn.microsoft.com/en-us/powershell/exchange/exchange-online-powershell-v2

Categories: