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.
Is there anyway to make a column for the Display Name?
I would also like to have the display name
Awesome Post! Thanks. Made it easy.