Tuesday, 16 May 2017

Debugging Activesync connections to a specific mailbox

Firstly enable the debugging on the desired mailbox with:

Set-CASMailbox <mailbox-name> -ActiveSyncDebugLogging:$true

Wait / replicate the problem and then generate a report with:

Exchange 2007 - 2010

Get-ActiveSyncDeviceStatistics -Mailbox alias -GetMailboxLog:$true -NotificationEmailAddress you@yourdomain.com

Exchange 2013+

Get-MobileDeviceStatistics -Mailbox alias -GetMailboxLog:$true -NotificationEmailAddresses you@yourdomain.com

Finally disable debugging when you are done (as these logs can be very verbose and consume a fiar bit of storage quite quickly!)

Set-CASMailbox <mailbox-name> -ActiveSyncDebugLogging:$false

When you receive the reports you should get something like:

Exchange ActiveSync Mailbox Logs - <MailboxName>

Date: 5/16/2017 11:30:09 AM

User name: <MailboxName>

Device type: iPhone
Device ID: 123456789ABCDEFGHIJKL

Device type: iPhone
Device ID: ABCDEFGHIJKL123456789
We can also quickly identify the user associated with the device with:

Get-ActiveSyncDevice | Where {$_.DeviceId -Match "123456789ABCDEFGHIJKL"} | Select UserDisplayName


Post a Comment