Office365 is increasingly popular among businesses as a managed email service with a plethora of features and competitive pricing. The best and most efficient way to administer your Exchange Online tenant is via Exchange PowerShell. It comes with no surprise that even the cheapest Office365 package that contains EOL comes with shell accessibility. The only question is how to access the shell easily with any machines that has PowerShell capability?
Here we sum up the two ways to do it. Both are usable as of today, the old way is using Basic authentication while the new way utilizes OAuth 2.0
You find other ways to connect to Exchange HERE
1. New Way
Simply issue these commands:
$cred = Get-Credential
Connect-ExchangeOnline -Credential $cred
2. Old Way
The old way resembles the normal way you import PowerShell sessions, however it will likely be deprecated in the future as it is using basic authentication which is considered overall less secure than the Modern authentication method.
$cred = Get-Credential
$ExchSession = New-PSSession -ConfigurationName microsoft.exchange -ConnectionUri https://outlook.office365.com/powershell-liveid -Authentication basic -Credential $cred -AllowRedirection
Import-PSSession $ExchSession -DisableNameChecking
Comments