Commands › Exchange Online

Test-PowerShellConnectivity

Exchange Online ExchangeOnlineManagement Test-*

Test client connectivity to Exchange remote PowerShell virtual directories. **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-PowerShellConnectivity — 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-PowerShellConnectivity -ConnectionUri <Uri> -TestCredential <PSCredential> | Format-List

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

Syntax — 2 parameter sets

URL

Test-PowerShellConnectivity -ConnectionUri <Uri> -TestCredential <PSCredential>
 [-Authentication <AuthenticationMethod>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-MailboxServer <ServerIdParameter>]
 [-MonitoringContext]
 [-ResetTestAccountCredentials]
 [-TrustAnySSLCertificate]
 [-WhatIf]
 [<CommonParameters>]

Identity

Test-PowerShellConnectivity [[-ClientAccessServer] <ServerIdParameter>]
 [-TestType <OwaConnectivityTestType>]
 [-VirtualDirectoryName <String>]
 [-Authentication <AuthenticationMethod>]
 [-Confirm]
 [-DomainController <Fqdn>]
 [-MailboxServer <ServerIdParameter>]
 [-MonitoringContext]
 [-ResetTestAccountCredentials]
 [-TrustAnySSLCertificate]
 [-WhatIf]
 [<CommonParameters>]

Parameters (13)

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.
-ConnectionUri Uri yes The ConnectionUri parameter specifies the URL of the remote PowerShell virtual directory to test, for example, `https://contoso.com/powershell`.
-TestCredential PSCredential yes The TestCredential parameter specifies the credentials to use for the test.
-Authentication AuthenticationMethod The Authentication parameter specifies the type of authentication that's used to connect. Valid values are:
-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.
-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...
-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.
-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.
-TestType OwaConnectivityTestType The TestType parameter specifies whether the command tests internal or external URLs. Values are Internal and External. The default value is Internal.
-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.
-VirtualDirectoryName String The VirtualDirectoryName parameter specifies the name of the remote PowerShell virtual directory that you want to test. Enclose values that contain spaces in quotation marks (").
-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.