PowerShell commands to connect to Exchange Online

As more and more businesses are moving to Office 365 for email, IM etc managing their respective service lines is a day to day task for an IT Engineer. Similar to managing your environment through the Office 365 portal, admins also use PowerShell for more flexibility every now and then. In order to perform any complex admin tasks on Exchange Online, admins need to connect to their O365 tenant. The below commands can help you achieve the same :

$UserCredential = Get-Credential

Click Enter Key after the above command. You will be asked to supply your O365 tenant credentials.

1

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection

Import-PSSession $Session

The modules will be loaded and you will be connected to Exchange Online.

2

Advertisements

One comment on “PowerShell commands to connect to Exchange Online

  1. Pingback: Recovering a mailbox in an Exchange Hybrid Environment | Anish Sam Johnes

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s