Connect to Exchange Online with Powershell

This can be done in 3 easy steps (taken from the article at

$UserCredential = Get-Credential

When prompted, enter your tenant logon (username@<tenant> information including password

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection

This creates a session object holding the connection to Exchange Online.

Import-PSSession $Session -DisableNameChecking

This imports the session (places it live) inside your current Powershell session. You could, of course, also do a

Enter-PSSession $Session

if you want to connect and run the commands remotely / directly on Exchange Online but then you lose all sorts of things like auto-complete.





Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.