How to Remote PowerShell into Exchange Online (Office 365)

13

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. admin@contoso.onmicrosoft.com.

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

$s = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell -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.

13 Comments

  1. Pingback: How to Remote PowerShell into Exchange Online (Office 365) « MS Digest « JC’s Blog-O-Gibberish

  2. Pingback: msdigest.net » How to Remote PowerShell into Exchange Online using Prefix

  3. Pingback: msdigest.net » How to Create a Shared Mailbox in Office 365

  4. Pingback: msdigest.net » The limits of Shared Mailboxes in Office 365

  5. Pingback: Manoug Beurekjian

  6. Pingback: msdigest.net » Script: Change-MailboxType available for download

  7. Pingback: msdigest.net » How to Remote PowerShell into Exchange Online Protection (Office 365)

  8. Pingback: Showing More Than Just Free/Busy Info On Your Exchange Room Mailboxes On Office365

  9. Pingback: How To: Change The Language and TimeZone Settings on Mailboxes in Office 365 - msdigest.net - by Peter Schmidt [MVP & MCSM]

Leave A Reply

Copyright 2005-2015 - Peter Schmidt.