Powershell command to check the last sync of mobile devices in exchange online.

Gurudas 886 Reputation points
2022-04-25T16:05:25.56+00:00

Hello Team,

Please let me know powershell command to check the last sync of mobile device in exchange online for a user

email : John.dave@Company portal .com
Exchange Online

Powershell: Get-ActiveSyncDevice -Mailbox “John.dave@Company portal .com”

Need lastsync details like Date, Time

Thank you in advance :)

Microsoft Exchange Online Management
Microsoft Exchange Online Management
Microsoft Exchange Online: A Microsoft email and calendaring hosted service.Management: The act or process of organizing, handling, directing or controlling something.
4,167 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Andy David - MVP 141.2K Reputation points MVP
    2022-04-25T16:21:31.473+00:00
     Get-MobileDeviceStatistics -Mailbox John.dave@contoso.com” |FL *sync*
    
    0 comments No comments

  2. Joyce Shen - MSFT 16,641 Reputation points
    2022-04-26T03:11:57.237+00:00

    Hi @GurudasSatardekar,

    Agree with the suggestion above from Andy, you could also take a reference at the script provided in the link here to get more information:
    Get Mobile Device Statistics In Exchange Online Using Powershell
    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    #Get all mobile devices in the org  
    $MobileDeviceList = Get-MobileDevice  
       
    #Alternatively, Get all mobile devices from a single user  
    $MobileDeviceList = Get-MobileDevice -Mailbox pcontreras@thesysadminchannel.com  
       
    foreach ($Device in $MobileDeviceList) {  
        $Stats = Get-MobileDeviceStatistics -Identity $Device.Guid.toString()  
        [PSCustomObject]@{  
            Identity              = $Device.Identity -replace "\\.+"  
            DeviceType            = $Device.DeviceType  
            DeviceOS              = $Device.DeviceOS  
            LastSuccessSync       = $Stats.LastSuccessSync  
            LastSyncAttemptTime   = $Stats.LastSyncAttemptTime  
            LastPolicyUpdateTime  = $Stats.LastPolicyUpdateTime  
            LastPingHeartbeat     = $Stats.LastPingHeartbeat  
            ClientType            = $Stats.ClientType  
        }  
    }  
    

    Which will return the result like below:
    196305-image.png


    If an Answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments