To connect to the Office 365 remote PowerShell, type the follwoing 3 commands in your local PowerShell:
$o365cred=get-credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $o365cred -Authentication Basic –AllowRedirection
Import-PSSession $session
If you get an error at this stage about the execution of scripts being disabled on the system, you should close Powershell and run again as Administrator. Then run the following command to allow the scripts to execute and start the sequence of commands again.
set-executionpolicy RemoteSigned
Updated: April 15, 2016