The Test-ActiveSyncConnectivity cmdlet allows you to simulate an Exchange ActiveSync connection from a mobile device to a mailbox. The mailbox can either be the test user mailbox you created earlier, or a specific mailbox user.

Running the cmdlet on a Client Access server will test the local server.

[PS] C:>Test-ActiveSyncConnectivity

CasServer  LocalSite     Scenario        Result  Latency(MS)
---------  ---------     --------        ------  -----------
e15mb1     Sydney        Options         Success
e15mb1     Sydney        FolderSync      Success
e15mb1     Sydney        First Sync      Success
e15mb1     Sydney        GetItemEstimate Success
e15mb1     Sydney        Sync Data       Success
e15mb1     Sydney        Ping            Success
e15mb1     Sydney        Sync Test Item  Success

The cmdlet can also be used to test a remote Client Access server.

[PS] C:>Test-ActiveSyncConnectivity -ClientAccessServer E15MB2

You can also test a specific URL.

[PS] C:>Test-ActiveSyncConnectivity -URL https://mail.exchange2013demo.com/Microsoft-Server-ActiveSync

If you have not provisioned the correct SSL certificates you can override the SSL trust requirement and still perform the test.

[PS] C:>Test-ActiveSyncConnectivity -TrustAnySSLCertificate

You can also use the pipeline to test multiple Client Access servers together.

[PS] C:>Get-ClientAccessServer | Test-ActiveSyncConnectivity

CasServer  LocalSite     Scenario        Result  Latency(MS)
---------  ---------     --------        ------  -----------
e15mb1     Sydney        Options         Success
e15mb1     Sydney        FolderSync      Success
e15mb1     Sydney        First Sync      Success
e15mb1     Sydney        GetItemEstimate Success
e15mb1     Sydney        Sync Data       Success
e15mb1     Sydney        Ping            Success
e15mb1     Sydney        Sync Test Item  Success
e15mb2     Sydney        Options         Success
e15mb2     Sydney        FolderSync      Success
e15mb2     Sydney        First Sync      Success
e15mb2     Sydney        GetItemEstimate Success
e15mb2     Sydney        Sync Data       Success
e15mb2     Sydney        Ping            Success
e15mb2     Sydney        Sync Test Item  Success

Finally, if you need to test a specific mailbox you can pass the credentials for that mailbox user to the cmdlet.

[PS] C:>$credential = Get-Credential -UserName e2013demopaul.cunningham -Message "Enter password"

[PS] C:>Test-ActiveSyncConnectivity -MailboxCredential $credential

About the Author

Paul Cunningham

Paul is a former Microsoft MVP for Office Apps and Services. He works as a consultant, writer, and trainer specializing in Office 365 and Exchange Server. Paul no longer writes for Practical365.com.

Comments

  1. Ram

    Hi Paul – Thanks to your reply.

    For Q1 – The certificate includes the following SAN (mail.ramxxx.ca, autodiscover.ramxxx.ca, ramxxx.ca) It does not include the Exchange Server name which is ex2016.ramxxx.ca

    For Q2 and Q3 – Issued by a trusted 3rd party which is Commodo + valid till Jun 2019.

    Thanks

    Ram

  2. Ram

    Hi Paul – I even tested Remote Connectivity Analyzer – The failed result is below:

    Attempting the FolderSync command on the Exchange ActiveSync session. The test of the FolderSync command failed.

    Exchange ActiveSync returned an HTTP 500 response (Internal Server Error).
    HTTP Response Headers:
    (removed)
    X-DiagInfo: EX2016
    X-BEServer: EX2016
    X-FEServer: EX2016
    Content-Length: 5856
    Cache-Control: private
    Server: Microsoft-IIS/10.0
    X-AspNet-Version: 4.0.30319
    X-Powered-By: ASP.NET
    Elapsed Time: 21004 ms.

  3. Ram

    Hi Paul – Hope you can help me with this error on ActiveSync.

    When, I run Get-ClientAccessServer | Test-ActiveSyncConnectivity – I am getting below error. I am using 3rd party certificate from Comodo.

    Lab Setup – Exchange 2016 CU7 on Server 2016

    Error:

    The underlying connection was closed:
    Could not establish trust relationship for the SSL/TLS secure channel.
    Inner error [System.Security.Authentication.AuthenticationException]:
    The remote certificate is invalid according to the validation procedure.

    Thanks

    Ram

    1. Avatar photo
      Paul Cunningham

      Your certificate is probably invalid then. The three requirements for certificate validity are:

      1) The name(s) on the certificate match the server name that you are connecting to
      2) The certificate is issued by a trusted certificate authority
      3) The certificate has not expired

  4. Gabriel

    Hello,
    I would appreciate your remarks here, I’m facing an issue with the credentials of my extest user, any ideas??

    [PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>Get-ClientAccessServer | Test-ActiveSyncConnectivity -TrustA
    nySSLCertificate | select ClientAccessServerShortName,Scenario,Result,LatencyInMillisecondsString,Error | ft -auto

    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    WARNING: No Client Access servers were tested.
    ClientAccessServerShortName Scenario Result LatencyInMillisecondsString Error
    ————————— ——– —— ————————— —–
    cassvr1004 Options Success 31.25
    cassvr1004 FolderSync Success 109.37
    cassvr1004 First Sync Success 78.12
    cassvr1004 GetItemEstimate Success 62.50
    cassvr1004 Sync Data Success 62.50
    cassvr1004 Ping Success 4359.28
    cassvr1004 Sync Test Item Success 62.50
    cassvr2004 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr2003 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr1003 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr2002 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr2001 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr1002 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr1001 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr2011 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr1011 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr1013 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr2013 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr3013 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr3012 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr3014 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…
    cassvr3011 Reset Credentials Failure [Microsoft.Exchange.Monitoring.Cas…

    [PS] C:\Program Files\Microsoft\Exchange Server\V14\scripts>

  5. Can

    when i run this command : Get-ClientAccessServer | Test-ActiveSyncConnectivity | fl

    result as below…do u have any offer ? Autodiscover dosent work on phone when i try to use ActiveSync but there is no problem on outlook.

    LocalSite : Default-First-Site-Name
    SecureAccess : True
    VirtualDirectoryName :
    Url :
    UrlType : Unknown
    Port : 0
    ConnectionType : Plaintext
    ClientAccessServerShortName : CASSERVER
    LocalSiteShortName : Default-First-Site-Name
    ClientAccessServer : istmrkexc01.kalyon.local
    Scenario : Options
    ScenarioDescription : Issue an HTTP OPTIONS command to retrieve the Exchange ActiveSync protocol version.
    PerformanceCounterName : DirectPush Latency
    Result : Failure
    Error : [System.Net.WebException]: The underlying connection was closed: Could not establish trus
    t relationship for the SSL/TLS secure channel. Inner error [System.Security.Authenticatio
    n.AuthenticationException]: The remote certificate is invalid according to the validation
    procedure.
    UserName : extest_db5c5c37c5614
    StartTime : 6/10/2016 11:02:36 AM
    Latency : -00:00:01
    EventType : Error
    LatencyInMillisecondsString :
    Identity :
    IsValid : True

    1. Neal

      Did you resolve this issue? I seem to have this issue. I run a test against the path
      test-ActiveSync Connectivity -URL https://mail.domain.com/Microosft-Active-Sync

      but it fails when I run a user test
      test-ActiveSyncConnectivity -Milboxcredential (get-credential)

  6. Swetha

    Hi Paul, Thanks for the article, I came across this when I searched for load testing the Active sync traffic. Can you please help me with any information that you can to enlighten me.

  7. Florian

    I have a 2010 and a 2013 environment and a problem with the ‘extest_*’ user.

    When I run the Test-ActiveSyncConnectiviy command from a 2010 server, its succesful.
    When I run it from a 2013 server, it fails.
    Error:
    “The user and the mailbox are in different AD sites…”

    The extest_ user i still on a 2010 database and I guess, thats the problem. However, I dont want to create a new one (is it even possible to have 2 extest user in the same environment?), regarding SCOM etc.

    Is there a workaround?

Leave a Reply