Connecting remotely via PowerShell to Office 365
Creating a new PowerShell session to administer remotely your Office 365 domains and users couldn't be easier.
And Windows PowerShell Integrated Scripting Environment (ISE) makes it even easier since you can write and save your scripts using a single Windows-based graphic user interface.
To connect remotely to Office 365 just launch a new PowerShell command prompt and execute the following commands:
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
Once you're done, just close the session using the following command:
Alternatively just use the attached script on PowerShell ISE.