Configuration guides for IT Administrators

PowerShell Connect to Exchange Online

PowerShell Connect to Exchange Online

In our previous article, PowerShell connect to AzureAD,  we’ve shown how to install and connect to AzureAD inorder to manage Microsoft 365 user and settings . However these does not have access to other settings hosted with Microsoft 365 like Exchange.  So, follow these steps to connect to Exchange Online.

Connect to Exchange Online using PowerShell without multifactor authentication enabled

PS C:\WINDOWS\system32> Import-Module MSOnline

For admin accounts without multifactor authentication, use the Get-Credential method.

###create credential object

PS C:\WINDOWS\system32> $Credential = Get-Credential

###build session

PS C:\WINDOWS\system32> $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $Credential -Authentication Basic –AllowRedirection

###import into PowerShell session

PS C:\WINDOWS\system32> Import-PSSession $Session

Leave a Reply

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

Lucas Brey

I’m Lucas Brey, a travel blogger sharing practical guides, hidden gems, and honest tips from the road. Follow along for smart itineraries, great food finds, and stories worth bookmarking.

Tags