For Office 365 administrators, there is a list of Exchange Online PowerShell cmdlets available. We can execute these cmdlets through SharePoint Online Management Shell or Windows PowerShell by creating a remote PowerShell session with Exchange Online. In this article, I’ll explain how to create a remote PowerShell session to Exchange Online and then execute Exchange Online PowerShell cmdlets.
Administrators can execute these PowerShell commands from their local computer using Remote PowerShell. The administrator can manage complete Exchange Online from the command line. First of all, we will create a remote PowerShell session and then see how to fetch the entire list of Exchange online commands which administrator can execute.
Here, I will explain this for SharePoint Online. So, the very first step is to install SharePoint Online Management Shell. For installing SharePoint Online Management Shell, please have a look on my old blog “SharePoint Online / Office 365: SharePoint Online Management Shell Installation”.
Once SharePoint Online Management Shell is ready, the next step is to make SharePoint Online Management Shell ready for connecting Office 365. For connecting to Office 365 the first time, we need to install the following two softwares:
- 64-bit version of the Microsoft Online Services Sign-in Assistant - Microsoft Online Services Sign-in Assistant for IT Professionals RTW.
- 64-bit version of the Microsoft Azure Active Directory module for Windows PowerShell
Please check https://technet.microsoft.com/en-us/library/dn975125.aspx for more details.
Once the required softwares are ready, we are ready to connect to Exchange Online.
Step 1
Get credentials using “Get-Credential” cmdlet as
$credential = Get-Credential
Once we execute this cmdlet, “Windows PowerShell credential” dialog box will appear.

Figure 1: Windows PowerShell credential request? Dialog
Enter your Office 365 account username and password and press OK. Once we have credentials, the next step is to create the PowerShell session PSSession using “New-PSSession” as




Join the conversation! Your thoughts help the community grow.