Get-MobileDevice does not show if devices are active or not and you need to query statistics for each device. The code below gave me actionable output.
$devices = Get-MobileDevice -ResultSize Unlimited | Where-Object {($_.ClientType -eq 'EAS' -or $_.ClientType -match 'ActiveSync') -and $_.ClientVersion -and ([version]$_.ClientVersion -lt [version]'16.1')}
$report = @()
foreach($device in $devices) {
$stat = Get-MobileDeviceStatistics -Identity $device.id
$report += [pscustomobject]@{
DeviceType = $device.DeviceType
DeviceOS = $device.DeviceOS
DeviceModel = $device.DeviceModel
DeviceName = $device.Name
UserDisplayName = $device.UserDisplayName
DistinguishedName = $device.DistinguishedName
Identity = $device.identity
LastSuccessSync = $stat.LastSuccessSync
}
}
$report | Out-Gridview