Note about MFA: If using MFA to authenticate your Admin user(s), you'll need to download a special PowerShell app (Basic Auth not supported) - see MS Article here

The full Microsoft article is here: but you may find our solution easier to follow. Read on...

Run PowerShell as an Administrator on your local computer, then type these commands:


set-executionpolicy unrestricted

(Agree to the policy change)

$UserCredential = Get-Credential


(Enter the credentials of a user with Administrator rights to Exchange Online)


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


Import-PSSession $Session


(Wait whilst the remote commands are imported)

You should now be able to use PowerShell to communicate directly to the Exchange Online server as if it were attached to your local network!

Now you can test communication using a simple command such as this:



A full list of commands are available here:

Useful commands:


Create a rule to send auto-replies from a shared mailbox:

Set-MailboxAutoReplyConfiguration -Identity -AutoReplyState Enabled -InternalMessage "Internal auto-reply message." -ExternalMessage "External auto-reply message."

### Set IMAP ###
Set-CasMailbox -ImapEnabled $true