Office 365: List Mobile Devices ActiveSync using Powershell
http://yshvili.com/wp-content/uploads/2016/03/listmobiloffice365-300x165.jpg
Script
#Connect to Exchange Online
$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection
Import-PSSession $Session
Get-Mailbox -ResultSize Unlimited | ForEach {Get-MobileDeviceStatistics -Mailbox:$_.Identity} | export-csv “c:\ActiveSyncDevices.csv”
Remove-PSSession $Session
Reference
Connect to Exchange Online using remote PowerShell