Office 365 – Connect to 365 with Powershell

Last updated on March 26th, 2018 at 09:39 am

$credential = get-credential
Import-Module MSOnline
Connect-MsolService -Credential $credential
$ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "https://outlook.office365.com/powershell-liveid/" -Credential $credential -Authentication "Basic" –AllowRedirection
Import-PSSession $ExchangeSession

You can save it in to ps1 file for quick use