Skip to content

How to connect to Exchange Online in PowerShell

Published: at 04:11 PM

This is a quick blog post about the commands needed to connect to Exchange Online via Powershell.

$UserCredential = Get-Credential  
  
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection  
  
Import-PSSession $Session -DisableNameChecking  
  

Remove-PSSession $Session