Skip to the main content.

1 min read

Reporting on ActiveSync

Exchange logs quite a bit of info about ActiveSync device partnerships and you can use this to create reports about the utilization of mobility features in your organization. Getting this data requires a couple of intermediate steps before you can export it to a CSV for processing in something like Excel (or another script). The PowerShell script below will export all of the ActiveSync device relationships in your organization. Keep in mind that this will include old relationships which are no longer active. Depending on how large your organization is and the number of device relationships out there, it may take a little while for the script to run.

Note: If you have a mixed version organization (e.g. Exchange 2007 and Exchange 2010), you’ll need to run the script twice. Once in the Exchange 2007 Management Shell and once in the Exchange 2010 Management Shell. The cmdlets used here are not backwards (or forward compatible). I’ve provided two versions of the script – one for Exchange 2007 and one for Exchange 2010.

Exchange 2007 Version

$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 Version

$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

You can open the exported CSV in Excel from here and generate reports based on that. There is quite a bit of information in the report including some personally identifiable information (PII) for the devices so keep that in mind before redistributing the raw data file.

This was written by Brian Desmond.

The Benefits of Transitioning to Microsoft Fabric for Power BI Users

The Benefits of Transitioning to Microsoft Fabric for Power BI Users

As Microsoft rolls out its comprehensive analytics platform, Microsoft Fabric, existing Power BI users face a pivotal moment of transition. This...

Facing SQL Server 2014 End of Support: Upgrade or Migrate?

Facing SQL Server 2014 End of Support: Upgrade or Migrate?

July 9th, 2024 marked theend of support(EOS), for SQL Server 2014following that of Windows and SQL Server 2012 in the past few years. This end of...

Microsoft Q2 2024 Licensing Updates

Microsoft Q2 2024 Licensing Updates

Microsoft continues to deliver a stream of thrilling announcements throughout 2024!