How to Connect to Exchange Online (Office 365) from Windows PowerShell

I’m presenting simple steps to follow to connect to your cloud based Exchange Online organization as the part of Office 365 from Windows Powershell

1. Install Windows PowerShell and Windows Remote Management (WinRM) on your computer (Windows 7 is already equiped with the features)

2. Open Windows Powershell (Run as Administrator) and run the following cmdlets

$LiveCred = Get-Credential You will be asked to provide the account information as below: Give user name and password

Run the cmdlet $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $LiveCred -Authentication Basic -AllowRedirection

You will get the following information at your powershell window:

WARNING: Your connection has been redirected to the following URI: “ ” WARNING: Your connection has been redirected to the following URI: “

Run the cmdlet Import-PSSession $SessionĀ 

A progress indicator appears that shows the importing of commands used in the cloud-based service into the client-side session of your local computer. When this process is complete, you can run these commands.

Now you are able to run all the allowed cmdlets in the session like get-mailbox, get-distributiongroup, get-messagetrackinglog etc. etc.

To disconnect the session run the cmdlet: Remove-PSSession $Session

How useful was this post?

Click on a star to rate it!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Leave a Reply

Your email address will not be published. Required fields are marked *

Protected by WP Anti Spam