Share via


How to collect ActiveSync device logs to troubleshoot sync issues between mobile devices and Exchange Online

Introduction

This article describes how to collect Exchange ActiveSync device logs to troubleshoot sync issues between mobile devices and Exchange Online in Microsoft 365. If you can't sync your mobile device to your mailbox, you might be asked by Microsoft 365 Support to collect logs for troubleshooting.

Procedure

To capture ActiveSync device log information, follow these steps:

  1. Connect to Exchange Online PowerShell.

  2. Run the following Set-CASMailbox cmdlet to enable ActiveSync logging for a specific user:

    Set-CASMailbox -Identity <user email address> -ActiveSyncDebugLogging $true
    

    Note

    Exchange ActiveSync debug logging is enabled for 48 hours in Exchange Online, and 72 hours in Exchange Server. After the time period expires, the value reverts to $false.

    To verify that ActiveSync debug logging is enabled for a user, run the following PowerShell cmdlet:

    Get-CasMailbox -Identity <user email address> -ActiveSyncDebugLogging | FL ActiveSyncDebugLogging
    

    Note

    If you don't use the -ActiveSyncDebugLogging switch when you check whether ActiveSync debug logging is enabled, the returned ActiveSyncDebugLogging value will always be False. For more information, see Get-CasMailbox.

  3. Reproduce the behavior that you want to capture.

  4. Run the following Get-MobileDeviceStatistics cmdlet to retrieve the log:

    Get-MobileDeviceStatistics -Mailbox TonySmith -GetMailboxLog -NotificationEmailAddresses "admin@contoso.com"
    

    Note

    This example retrieves the statistics for the mobile phone configured to synchronize with the mailbox that belongs to the user Tony Smith. It also outputs the log file and sends it to the System Administrator at admin@contoso.com.