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.

Effective Insider Threat Detection Strategies

Effective Insider Threat Detection Strategies

In this blog we're going to explore innovative approaches for detecting insider threats within organizations and safeguarding sensitive data. In 2021...

Protect Your Microsoft 365 Data with a Reliable Backup Solution

Protect Your Microsoft 365 Data with a Reliable Backup Solution

Learn why it is essential to protect your Microsoft 365 data and how a reliable backup, like Microsoft 365 Backup, can safeguard your email and...

Cloud Infrastructure Modernization: Update the Way Your Business Operates

Cloud Infrastructure Modernization: Update the Way Your Business Operates

Are you still doing things the old way? Many organizations across industries are stalled by their legacy technology that is limiting their business...