Powershell1 min read

Connecting to Office 365 Exchange Online via PowerShell

Easily connect to Office 365 Exchange Online via PowerShell

Very simple set of lines to connect to Office 365’s Exchange Online management in PowerShell. Once connected using the below you can then start running commands such as Get-Mailbox etc.

$UserCredential = Get-Credential

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

Import-PSSession $Session -DisableNameChecking

Leave a comment

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.