To check if the user’s ActiveSync is enabled

Set-ExecutionPolicy RemoteSigned $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session -DisableNameChecking Remove-PSSession $Session Get-CASMailbox UPN

Connect PowerShell to Office 365 services

Unlike the on-premise set-up, it pretty easy to start the session, but with Office 365, you need to connect to each services and you also need to use the right module. Connect to Exchange Online (use windows Exchange PS or Azure AD PS) Set-ExecutionPolicy RemoteSigned  /Use global admin credential/ $cred = get-credential $Session = New-PSSession [...]