Set-ExecutionPolicy RemoteSigned $LiveCred = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection Import-PSSession $Session

If you need to enable Office 365 Archive for all users: Get-Mailbox -Filter {ArchiveStatus -Eq “None” -AND RecipientTypeDetails -eq “UserMailbox”} | Enable-Mailbox -Archive If you need to enable Office 365 Litigation hold for all users: Get-Mailbox | Set-Mailbox -LitigationHoldEnabled $true -LitigationHoldDuration  2555 Remove  “ -LitigationHoldDuration  2555″ to retain forever or change number for days to …