Exchange
2 out of 7 rated this helpful - Rate this topic

Test-ActiveSyncConnectivity

Applies to: Exchange Server 2007 SP3, Exchange Server 2007 SP2, Exchange Server 2007 SP1

Topic Last Modified: 2010-08-18

The Test-ActiveSyncConnectivity cmdlet lets you perform a full synchronization against a specified mailbox to test the configuration of Microsoft Exchange ActiveSync.


test-ActiveSyncConnectivity [-ClientAccessServer <ServerIdParameter>] [-URL <String>] [-AllowUnsecureAccess <SwitchParameter>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-LightMode <SwitchParameter>] [-MailboxCredential <PSCredential>] [-MailboxServer <ServerIdParameter>] [-MonitoringContext <SwitchParameter>] [-MonitoringInstance <String>] [-ResetTestAccountCredentials <SwitchParameter>] [-Site <AdSiteIdParameter>] [-Timeout <UInt32>] [-TrustAnySSLCertificate <SwitchParameter>] [-UseAutodiscoverForClientAccessServer <SwitchParameter>] [-WhatIf [<SwitchParameter>]]

The Test-ActiveSyncConnectivity cmdlet performs a full synchronization between a mobile device and a specified mailbox to test the functionality of Exchange ActiveSync. If the synchronization fails, a message is displayed in the Exchange Management Shell.

To run the Test-ActiveSyncConnectivity cmdlet, the account you use must be delegated the Exchange Server Administrator role and local Administrators group for the target server.

For more information about permissions, delegating roles, and the rights that are required to administer Microsoft Exchange Server 2007, see Permission Considerations.

Parameter Required Type Description

AllowUnsecureAccess

Optional

System.Management.Automation.SwitchParameter

This parameter allows the test to continue over an unsecured channel that does not require Secure Sockets Layer (SSL).

ClientAccessServer

Optional

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

This parameter specifies the Client Access server computer the device uses to synchronize.

Confirm

Optional

System.Management.Automation.SwitchParameter

This parameter causes the command to pause processing and requires that you acknowledge what the command will do before processing continues. You do not have to specify a value with the Confirm parameter.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

This parameter specifies the domain controller to connect to for Active Directory directory service validation.

LightMode

Optional

System.Management.Automation.SwitchParameter

This parameter instructs the cmdlet to perform only a subset of the connectivity tests. The tests that are performed are the Options and FolderSync commands.

MailboxCredential

Optional

System.Management.Automation.PSCredential

This parameter specifies the mailbox the device synchronizes with.

MailboxServer

Optional

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

This parameter specifies the Mailbox server computer that contains the associated mailbox.

MonitoringContext

Optional

System.Management.Automation.SwitchParameter

This parameter specifies whether the test result is passed to Microsoft Operations Manager (MOM). If this parameter is set to $true, the test result is passed to MOM. If this parameter is set to $false, the test result appears only on the command line.

MonitoringInstance

Optional

System.String

This parameter specifies whether the task is to be run against the mailbox of the user currently running the task. It is only used when this task is run from MOM.

ResetTestAccountCredentials

Optional

System.Management.Automation.SwitchParameter

The ResetTestAccountCredentials parameter resets the password for the test account used to perform this command. The password for the test account is typically reset every seven days if you're using Microsoft System Center Operations Manager to manage your Exchange environment. Use of this flag forces a password reset at any time if it's required for security reasons.

Site

Optional

Microsoft.Exchange.Configuration.Tasks.AdSiteIdParameter

The Site parameter is used to specify the Active Directory site.

Timeout

Optional

System.UInt32

This parameter specifies the amount of time (in seconds) to wait for a response from the cmdlet.

TrustAnySSLCertificate

Optional

System.Management.Automation.SwitchParameter

This parameter allows the test to use any available SSL certificate to run the test.

URL

Optional

System.String

This parameter specifies the external URL for Exchange ActiveSync.

UseAutodiscoverForClientAccessServer

Optional

System.Management.Automation.SwitchParameter

This parameter specifies whether the test should use the Autodiscover service to locate the Client Access server computer.

WhatIf

Optional

System.Management.Automation.SwitchParameter

This parameter instructs the command to simulate the actions that it would take on the object. By using this parameter, you can view what changes would occur without having to apply any of those changes. You do not have to specify a value with this parameter.

Error Description

 

 

Exceptions Description

 

 

The following code example tests the Exchange ActiveSync connectivity for the mailbox PaulA.

Test-ActiveSyncConnectivity -MailboxCredential "PaulA"
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Error in the example
The example will result in an error as described by Wacka.

An easier way to carry out this operation would be:

$cred=(Get-Credential)

You will then be prompted for a Username and password for the user. Enter the user name and password in the logon box.

Then enter the command below:

Test-ActiveSyncConnectivity -ClientAccessServer "CAS Name" -MailboxCredential $cred
Error will occur if Autodiscover is not configured
Executing the provided example will result in the following error if Autodiscover is not configured.

[System.Net.WebException]: 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.


http://social.technet.microsoft.com/Forums/en/exchangesvradmin/thread/bf599cb3-cc72-4487-bbe0-b5d172feb53b
Error with provided example
Trying to execute the example provided above results in an error about being unable to convert from a String to a PSCredential. Instead, you can create the PSCredential first, and then you can use it to run Test-ActiveSyncConnectivity, as in the following example:

Securely store your password (will cause a password prompt to appear into which you will need to type the password):

$secpass = Read-Host "Enter password to store securely." -asSecureString

The following will create the credential object (be sure to enter in the username in place of "userName"):

$myCred = New-Object System.Management.Automation.PSCredential -ArgumentList "userName", $secpass

Now you can execute the above command:

Test-ActiveSyncConnectivity -MailboxCredential $myCred

If you get an error that "The Client Access server was not specified", then you will will need to run the command from your client access server (CAS), or provide the CAS name as a parameter, as in the following example:

Test-ActiveSyncConnectivity -ClientAccessServer "CasServerName" -MailboxCredential $myCred