PowerShell connection to exchange online
by sij /
First of all you need to open a powershell window.
Enter user credentials for accessing Office 365
$UserCredential = Get-Credential
Open the connection
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Get the remote commands
Import-PSSession $Session -DisableNameChecking
Disconnect afterwards
Remove-PSSession $Session