How to Remote PowerShell into Exchange Online (Office 365)


As described in my previous blog post last week, it is possible to use PowerShell to manage your Office 365. It is also possible to use Remote PowerShell to manage administrative tasks and Exchange settings within your Exchange Online Tenant (Office 365).

You don’t need Office 365 MS Online PowerShell module for managing your Exchange Online configuration with PowerShell. The process is very similar to how you would configure an implicit remote session to an on-premise Exchange 2010 server.

To connect to Exchange Online, just start a PowerShell session and type in following commands:

$Cred = Get-Credential


The above command prompts you, for your Office 365 tenant admin credentials, it is important to enter as UPN format, such as e.g.

Next, we will create a new remote PowerShell session using the following cmdlet:

$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $cred -Authentication Basic –AllowRedirection

Next, import the cmdlets to your local PowerShell session, using the following command:

Import-PSSession $s


You are now connected to Exchange Online with you Office 365 Tenant admin and can use Exchange Online PowerShell cmdlets available.

For information about Exchange Online PowerShell cmdlets available see Reference to Available PowerShell Cmdlets in Exchange Online.

To remove the PowerShell session again, run the following command:

Remove-PSSession $s


About Author

Peter is an Exchange specialist with over 15+ years of experience with Exchange Server and certified Microsoft Certified Master (MCM) and Microsoft Certified Solutions Master (MCSM) on Exchange Server. He has been awarded the Microsoft MVP award, every year since 2007. He is active in the Microsoft community and User Group Leader for CoLabora (a danish UC & Cloud User Group). He works as an Cloud & Infrastructure Architect and Consulent, with primary focus on Exchange, Office 365, Azure and Skype for Business.


  1. Hi Peter,

    Would I necessarily always have Exchange online enabled? I’ve just setup an Office365 trial and I can’t seem to get PS Remoting to work.


Copyright 2005-2015 - Peter Schmidt.