01 September 2015

Display all active sync devices

Need a report on all the ActiveSync devices in Exchange 2010 & 2013?
This oneliner will do just that:

Get-MobileDevice | select-object DeviceModel,FriendlyName,DeviceOS,UserDisplayName | 
sort-object devicemodel | Out-GridView

Or get an overview of the number of types per type. (May take a while, depending on the number activesync devices in your organisation)

(Get-CASMailbox -ResultSize unlimited -filter {HasActiveSyncDevicepartnership -eq $true} | Get-Mailbox) | 
Foreach {Get-MobileDeviceStatistics -Mailbox $_} | Group Devicemodel | Sort Count -Descending | Select Count, Name

Find and remove all devices that have not synced over 30 days:

$DevicesToRemove = Get-MobileDevice -result unlimited | 
Get-MobileDeviceStatistics | where {$_.LastSuccessSync -le (Get-Date).AddDays("-30")}
$DevicesToRemove | foreach-object {Remove-MobileDevice ([string]$_.Guid) -confirm:$false}

No comments:

Post a Comment