Connect to Office 365 and Exchange via Powershell


You will need to have the below installed on your PC

Microsoft Online Services Sign-in Assistant: 

Azure AD Module for Windows PowerShell 


Connect to Office 365

  1. Open powershell (I always run as admin)
  2. Paste the below into the powershell window

    $cred = Get-Credential

    Import-Module MSOnline

    Connect-MsolService -Credential $cred

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

    $importresults = Import-PSSession $s


You will be prompted to enter the office365 username and password and then you should connect up as shown below.

Comments 1

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.