Item:
How to connect to Exchange online (Office 365) via Powershell
Method:
1\ Open PowerShell and run :
$UserCredential = Get-Credential
2\ Enter user credentials into window which appears
3\ Enter command:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
4\ Enter command:
Import-PSSession $Session
To exit the session:
Remove-PSSession $Session
Link:
https://technet.microsoft.com/en-us/library/jj984289(v=exchg.160).aspx