Commands › Exchange Online

Test-ImapConnectivity

Exchange Online ExchangeOnlineManagement Test-*

Verify that connectivity to the Microsoft Exchange IMAP4 service is working as expected. **Note**: This cmdlet works best in Exchange 2010. In later versions of Exchange, the functionality of this cmdlet is replaced by Managed Availability. For the best results, use the Invoke-MonitoringProbe cmdlet and specify the relevant active monitor probe instead of using this cmdlet.

Quick start script

# Test-ImapConnectivity — quick start (serv365.ai)
# 1. Connect (app-only shown; interactive: omit the certificate parameters)
Connect-ExchangeOnline -CertificateThumbprint $thumb -AppId $appId -Organization $org

# 2. Run and inspect
Test-ImapConnectivity | Format-List

# 3. Export for evidence / drift tracking
Test-ImapConnectivity | Export-Clixml .\ImapConnectivity-$(Get-Date -Format yyyyMMdd).xml

Syntax

Test-ImapConnectivity [[-ClientAccessServer] <ServerIdParameter>]
 [-Confirm]
 [-ConnectionType <ProtocolConnectionType>]
 [-DomainController <Fqdn>]
 [-LightMode]
 [-MailboxCredential <PSCredential>]
 [-MailboxServer <ServerIdParameter>]
 [-MonitoringContext]
 [-PerConnectionTimeout <Int32>]
 [-PortClientAccessServer <Int32>]
 [-ResetTestAccountCredentials]
 [-Timeout <UInt32>]
 [-TrustAnySSLCertificate]
 [-WhatIf]
 [<CommonParameters>]

Parameters (14)

ParameterTypeRequiredWhat it controls
-ClientAccessServer ServerIdParameter The ClientAccessServer parameter specifies the Exchange server to test. This server has the Client Access server role installed, and is responsible for accepting client connections.
-Confirm SwitchParameter The Confirm switch specifies whether to show or hide the confirmation prompt. How this switch affects the cmdlet depends on whether the cmdlet requires confirmation before proceeding.
-ConnectionType ProtocolConnectionType The ConnectionType parameter specifies the type of connection that's used to connect to the IMAP4 service. Valid values are:
-DomainController Fqdn The DomainController parameter specifies the domain controller that's used by this cmdlet to read data from or write data to Active Directory. You identify the domain controller by its fully qualified domain name...
-LightMode SwitchParameter The LightMode switch tells the command to perform only a test logon to the server by using the IMAP4 protocol. You don't need to specify a value with this switch.
-MailboxCredential PSCredential The MailboxCredential parameter specifies the mailbox credential to use for a single mailbox test.
-MailboxServer ServerIdParameter The MailboxServer parameter specifies the Exchange Mailbox server that you want to test. This parameter identifies the backend server that accepts proxied connections from the frontend server where clients connect.
-MonitoringContext SwitchParameter The MonitoringContext switch includes the associated monitoring events and performance counters in the results. You don't need to specify a value with this switch.
-PerConnectionTimeout Int32 The PerConnectionTimeout parameter specifies the amount of time, in seconds, to wait per connection for the test operation to finish. Valid values are between 0 and 120 seconds. The default value is 120 seconds.
-PortClientAccessServer Int32 The PortClientAccessServer parameter specifies the port to use to connect to the Client Access server. The default port is 143 for IMAP4. The valid range is from 0 through 65,535.
-ResetTestAccountCredentials SwitchParameter The ResetTestAccountCredentials switch resets the password for the test account that's used to run this command. You don't need to specify a value with this switch.
-Timeout UInt32 The Timeout parameter specifies the amount of time, in seconds, to wait for the test operation to finish. Valid values are between 0 and 3600 seconds (1 hour). The default value is 180 seconds (3 minutes).
-TrustAnySSLCertificate SwitchParameter The TrustAnySSLCertificate switch allows Exchange to accept certificates from untrusted certification authorities (CAs). You don't need to specify a value with this switch.
-WhatIf SwitchParameter The WhatIf switch shows what the command does without making any changes. You don't need to specify a value with this switch.

Reference facts derived from Microsoft documentation, © Microsoft, licensed CC BY 4.0; restructured with original guidance by serv365.ai.