Connect to O365 exchange with powershell using session import

By Tom Kitching

It seems fairly obvious but a lot of people are unsure how to import a remote powershell session to O365. Simply do the following: $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session