Report of mobile ActiveSync devices from Exchange 2007 or Exchange 2010

If you want to run a report of mobile devices connected to Exchange 2007 or Exchange 2010, the two PowerShell commands will export the results to CSV format. Just copy and paste into notepad and save as a script.PS1, then run (./script.ps1) from the Exchange Management Shell.

Exchange 2007

$devices = @()
$mailboxes = Get-CASMailbox -ResultSize:Unlimited | Where-Object {$_.HasActiveSyncDevicePartnership -eq $true -and $_.ExchangeVersion.ExchangeBuild -ilike "8*"}

foreach ($m in $mailboxes)
{
    $devices += Get-ActiveSyncDeviceStatistics -Mailbox $m.Identity
}

$devices | Export-Csv DeviceStats.csv

Exchange 2010

$devices = @()
$mailboxes = Get-CASMailbox -ResultSize:Unlimited | Where-Object {$_.HasActiveSyncDevicePartnership -eq $true -and $_.ExchangeVersion.ExchangeBuild -ilike "14*"}

foreach ($m in $mailboxes)
{
    $devices += Get-ActiveSyncDeviceStatistics -Mailbox $m.Identity
}

$devices | Export-Csv DeviceStats.csv

Thanks to http://briandesmond.com/blog/how-to-create-an-activesync-device-report/ for this information.

3 Comments

  1. Mark Balcerak

    Is there anyway to make a column for the Display Name?

  2. I would also like to have the display name

  3. Awesome Post! Thanks. Made it easy.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s