Applies to: Exchange Server 2013

Topic Last Modified: 2012-09-17

Use the Test-Mailflow cmdlet to diagnose whether mail can be successfully sent from and delivered to the system mailbox on a Mailbox server. You can also use this cmdlet to verify that email is sent between Mailbox servers within a defined latency threshold.

Syntax

Test-Mailflow -AutoDiscoverTargetMailboxServer <SwitchParameter> [-Identity <ServerIdParameter>] <COMMON PARAMETERS>
Test-Mailflow -TargetEmailAddress <String> [-Identity <ServerIdParameter>] [-TargetEmailAddressDisplayName <String>] <COMMON PARAMETERS>
Test-Mailflow [-Identity <ServerIdParameter>] <COMMON PARAMETERS>
Test-Mailflow -TargetDatabase <DatabaseIdParameter> [-Identity <ServerIdParameter>] <COMMON PARAMETERS>
Test-Mailflow -TargetMailboxServer <ServerIdParameter> [-Identity <ServerIdParameter>] <COMMON PARAMETERS>
Test-Mailflow -CrossPremises <$true | $false> [-CrossPremisesExpirationTimeout <EnhancedTimeSpan>] [-CrossPremisesPendingErrorCount <Int32>] <COMMON PARAMETERS>
COMMON PARAMETERS: [-ActiveDirectoryTimeout <Int32>] [-Confirm [<SwitchParameter>]] [-DomainController <Fqdn>] [-ErrorLatency <Int32>] [-ExecutionTimeout <Int32>] [-MonitoringContext <$true | $false>] [-WhatIf [<SwitchParameter>]]

Examples

EXAMPLE 1

This example tests message flow from the server name Mailbox1 to the server named Mailbox2.

Copy Code
Test-Mailflow Mailbox1 -TargetMailboxServer Mailbox2

EXAMPLE 2

This example tests message flow from the server named Mailbox1 to the email address john@contoso.com.

Copy Code
Test-Mailflow Mailbox1 -TargetEmailAddress john@contoso.com

Detailed Description

The Test-Mailflow cmdlet tests mail submission, transport, and delivery. The cmdlet verifies that each Mailbox server can successfully send itself a message. You can also use this cmdlet to verify that the system mailbox on one Mailbox server can successfully send a message to the system mailbox on another Mailbox server.

If more than one of these parameters is specified, the AutoDiscoverTargetMailboxServer parameter takes precedence over the TargetEmailAddress and TargetMailboxServer parameters. The TargetMailboxServer parameter takes precedence over the TargetEmailAddress parameter. A system mailbox must be present on all servers involved in the test.

You need to be assigned permissions before you can run this cmdlet. Although all parameters for this cmdlet are listed in this topic, you may not have access to some parameters if they're not included in the permissions assigned to you. To see what permissions you need, see the "Testing mail flow" entry in the Mail Flow Permissions topic.

Parameters

Parameter Required Type Description

AutoDiscoverTargetMailboxServer

Required

System.Management.Automation.SwitchParameter

The AutoDiscoverTargetMailboxServer parameter specifies whether to automatically populate a list of target Mailbox servers to which to send a test message. The task queries Active Directory to discover all Mailbox servers and then sends each server a test message.

CrossPremises

Required

System.Boolean

The CrossPremises parameter specifies whether the mail flow test will be conducted in cross-premises mode.

Set this parameter to $true if your organization is using a cross-premises deployment and you want to verify cross-premises mail flow.

TargetDatabase

Required

Microsoft.Exchange.Configuration.Tasks.DatabaseIdParameter

The TargetDatabase parameter specifies the mailbox database to which test messages are sent.

TargetEmailAddress

Required

System.String

The TargetEmailAddress parameter specifies the SMTP address of the mailbox to which test messages are sent. Use this parameter to send test messages to a Mailbox server in a remote forest. If this parameter is used, the test is always a remote test.

TargetMailboxServer

Required

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

The TargetMailboxServer parameter specifies one or more Mailbox servers in the local Exchange organization to which test messages are sent.

ActiveDirectoryTimeout

Optional

System.Int32

The ActiveDirectoryTimeout parameter specifies the number of seconds that elapse before the task provides an informational message about the delay. The default value is 15 seconds.

Confirm

Optional

System.Management.Automation.SwitchParameter

The Confirm switch causes the command to pause processing and requires you to acknowledge what the command will do before processing continues. You don't have to specify a value with the Confirm switch.

CrossPremisesExpirationTimeout

Optional

Microsoft.Exchange.Data.EnhancedTimeSpan

The CrossPremisesExpirationTimeout parameter is used when this cmdlet is executed by Microsoft System Center Operations Manager 2007 agents for asynchronous monitoring. We don't recommend using this parameter when running this cmdlet manually.

CrossPremisesPendingErrorCount

Optional

System.Int32

The CrossPremisesPendingErrorCount parameter is used when this cmdlet is executed by System Center Operations Manager 2007 agents for asynchronous monitoring. We don't recommend using this parameter when running this cmdlet manually.

DomainController

Optional

Microsoft.Exchange.Data.Fqdn

The DomainController parameter specifies the fully qualified domain name (FQDN) of the domain controller that retrieves data from Active Directory.

ErrorLatency

Optional

System.Int32

The ErrorLatency parameter specifies how long to wait for a test message to be delivered before an error event is logged in Microsoft System Center Operations Manager 2007. The default value when a test message is sent to the local Mailbox server is 15 seconds and 180 seconds when a test message is sent to a remote Mailbox server.

ExecutionTimeout

Optional

System.Int32

The ExecutionTimeout parameter specifies the maximum time that this task can run before the test is determined to be a failure. If no test message or delivery report arrives before this time expires, the task ends and an error is reported. When the task is run in the Exchange Management Shell, the default setting is 240 seconds. When the MonitoringContext parameter is used, the default setting is 15 seconds.

Identity

Optional

Microsoft.Exchange.Configuration.Tasks.ServerIdParameter

The Identity parameter specifies the source Mailbox server name from which a test message is sent. The default value is the local Mailbox server.

MonitoringContext

Optional

System.Boolean

The MonitoringContext parameter includes or excludes the associated monitoring events and performance counters in the results. Valid input for this parameter is $true or $false. The default value is $false. If you specify the value $true, the monitoring events and performance counters are included in the command results. Typically, you include the monitoring events and performance counters in the results when the output is passed to Microsoft System Center Operations Manager 2007 or System Center 2012 - Operations Manager.

TargetEmailAddressDisplayName

Optional

System.String

The TargetEmailAddressDisplayName parameter specifies the display name of the mailbox to which test messages are sent.

WhatIf

Optional

System.Management.Automation.SwitchParameter

The WhatIf switch instructs the command to simulate the actions that it would take on the object. By using the WhatIf switch, you can view what changes would occur without having to apply any of those changes. You don't have to specify a value with the WhatIf switch.

Input Types

To see the input types that this cmdlet accepts, see Cmdlet Input and Output Types. If the Input Type field for a cmdlet is blank, the cmdlet doesn’t accept input data.

Return Types

To see the return types, which are also known as output types, that this cmdlet accepts, see Cmdlet Input and Output Types. If the Output Type field is blank, the cmdlet doesn’t return data.