Following instructions will help to connect Windows PowerShell to your Microsoft Exchange Online or Office 365 service.
- Run Windows Power Shell as Administrator
- Run Set-ExecutionPolicy Unrestricted
- Run $LiveCred = Get-Credential
- Provide your Office 365 administrator account credentials
- Run $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
- Run Import-PSSession $Session
You should now be connected to your Office 365 account. To test connection you can run Get-Mailbox which should list all mailboxes in your Hosted Exchange account.
To disconnect from the service run: Remove-PSSession $Session