Code Dump: Remove Active Sync Devices Older than 90 Days

Get-CASMailbox -ResultSize unlimited -Filter{(HasActiveSyncDevicePartnership -eq $true) -AND (name -notlike "cas_*") -AND (name -notlike "DiscoverysearchMailbox*")} | ForEach {Get-mobileDeviceStatistics -Mailbox:$_.Identity | Where-Object {$_.LastSuccessSync -le (Get-Date).AddDays("-90")}} | Remove-MobileDevice