Archive

Posts Tagged ‘Remote PowerShell’

How to Remote PowerShell into Exchange Online (Office 365)

March 19th, 2012 2 comments


image

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.

SNAGHTML8a731f
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