Required to connect to Exchange Online via PowerShell to complete a task that is no longer possible via the GUI? Every wondered how to do this or install the module on your local device etc, the good news is if so then you are not alone. Hence, the following this post should assist you in completing this task. This is particular helpful if you have recently carried out a migration to Exchange Online or are part of the way through the process at present. Also, the official Microsoft guide that shows PowerShell commands can be found on the following site.
How to: Connect to Exchange Online PowerShell
The first requirement we have is to install the latest version of ExchangeOnline module at time of writing this is version 3.1.0.
To do this Right click PowerShell and select “Run as Administrator” and enter the below command to install this as (all users)
Install-Module -Name ExchangeOnlineManagement -Force
To install the module as the current logged in user and not everyone on the device run the below command.
Install-Module -Name ExchangeOnlineManagement -Scope CurrentUser
Import Exchange Online PowerShell Module
Now the module is available we will learn to import it, secondly to do so simple run the below PowerShell command to import the latest version of the Exchange Online Management Module we have just installed.
Connect & Authenticate
Finally after completing the install task and Importing the module we can finally connect via running the below command.
Once this has been entered you will be shown an AUTH screen to complete the login. Generally depending on how things are configured your details may be saved already. Regardless, if not click the “Use Another Account” option and enter your user name and credentials. Finally you will then connected to Exchange Online via PowerShell
The below will show a successful connection to Exchange Online
Additional Details: Exchange
If you want to find more details please visit the attached tech net article from Microsoft for more details.
Please feel free to drop a comment below or share this blog post if it has helped you.