Connect to Exchange Online PowerShell

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

Prerequisites

Commands

Check Windows PowerShell version

PS C:\Users\Administrator> Get-Host

Enable Windows PowerShell to run signed scripts

PS C:\Users\Administrator> Set-ExecutionPolicy RemoteSigned

Open Session

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

Close Session

PS C:\Users\Administrator> Remove-PSSession $Session

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

Licence Creative Commons
This website http://shebangthedolphins.net is licensed to the public under a licence Creative Commons Attribution licence.
Contact :