1. Connect to the cloud :
Connect to Office 365 :
Open Windows PowerShell.
Enter the credentials of an administrator account in the cloud-based organization using the following command –>
$LiveCred = Get-Credential
Create a connection to the cloud-based organization using the following command –>
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $livecred -Authentication Basic -AllowRedirection
Load the Exchange cmdlets on the local computer using the following commands–>
Import-PSSession $Session
Disconnect from the session :
Remove-PSSession $Session