Connect to Exchange Online PowerShell

How to connect to remote PowerShell allowing to manage Exchange Online from the command line.

Instructions

Install

microsoftonline.com sign on from internet explorer microsoftonline.com sign on from internet explorer microsoftonline.com sign on from internet explorer microsoftonline.com hybrid menu

Note : it seems to work from Internet Explorer only (when it works..), otherwise you will have a Application cannot be started. Contact application vendor.

microsoftonline.com hybrid menu microsoftonline.com hybrid menu microsoftonline.com hybrid menu microsoftonline.com hybrid menu

Connect

PS C:\Users\Administrator> Connect-EXOPSSession -UserPrincipalName LOGIN@YOUR.DOMAIN

Old Method (depreciated)

This method doesn't work with MFA.

Commands

PS C:\Users\Administrator> Get-Host
PS C:\Users\Administrator> Set-ExecutionPolicy RemoteSigned
PS C:\Users\Administrator> $UserCredential = Get-Credential
PS C:\Users\Administrator> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
PS C:\Users\Administrator> Import-PSSession $Session
PS C:\Users\Administrator> Remove-PSSession $Session

Source : https://technet.microsoft.com/

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :