Connect to O365 exchange with powershell using session import
It seems fairly obvious but a lot of people are unsure how to import a remote powershell session to O365. Simply do the following:
1 2 |
[cc lang="powershell"]$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session[/cc] |