To export mail flow connectors in Exchange Online, read the inbound connectors with Get-InboundConnector and the outbound connectors with Get-OutboundConnector, and write each to CSV. On its own, Get-OutboundConnector leaves out connectors in test mode and connectors scoped to mail flow rules, so ask for those as well.
| Method | Best fit |
|---|---|
| PowerShell | 2 CSV files of every inbound and outbound connector with their TLS, sender and routing settings. |
| Admin centre | A quick look at the connectors list and 1 connector's details. |
| Altivane | Recommended for recurring reviews, with each connector flagged where its settings need a look. |
Before you start
Use an account in the Organization Management role group, which Microsoft lists for connectors in Exchange Online. Microsoft says members of View-Only Management can view the configuration of the same features.
Connectors carry mail between Microsoft 365 and your own email servers or a partner organisation. A tenant with none set up has none to export, and the Hybrid Configuration Wizard creates its own. The examples read the connectors and export them; they turn none on or off, validate none and change nothing.
Option 1
Export mail flow connectors with PowerShell
Install the module once, then connect and export the inbound and outbound connectors to 2 CSV files. The outbound connectors are read 4 ways, once for each combination of the test mode and rule scope filters, and each is kept once.
# Install once, if the module is not already installed.
Install-Module ExchangeOnlineManagement -Scope CurrentUser$ErrorActionPreference = 'Stop'
Connect-ExchangeOnline -ShowBanner:$false
try {
$inbound = @(Get-InboundConnector -ResultSize Unlimited | ForEach-Object {
[pscustomobject]@{
Name = $_.Name; Enabled = $_.Enabled; Type = $_.ConnectorType
SenderDomains = ($_.SenderDomains -join '; ')
SenderIPAddresses = ($_.SenderIPAddresses -join '; ')
RequireTls = $_.RequireTls; Certificate = $_.TlsSenderCertificateName
RestrictToIPAddresses = $_.RestrictDomainsToIPAddresses
RestrictToCertificate = $_.RestrictDomainsToCertificate
TreatAsInternal = $_.TreatMessagesAsInternal; Changed = $_.WhenChanged
}
})
# Each filter returns only the connectors that match it, so all 4 are read.
$filters = @(
@{}, @{ IsTransportRuleScoped = $true }, @{ IncludeTestModeConnectors = $true },
@{ IsTransportRuleScoped = $true; IncludeTestModeConnectors = $true }
)
$seen = @{}
$outbound = @(foreach ($filter in $filters) {
foreach ($connector in Get-OutboundConnector @filter -ResultSize Unlimited) {
$key = "$($connector.Identity)"
if ($seen.ContainsKey($key)) { continue }
$seen[$key] = $true
[pscustomobject]@{
Name = $connector.Name; Enabled = $connector.Enabled
Type = $connector.ConnectorType
RecipientDomains = ($connector.RecipientDomains -join '; ')
SmartHosts = ($connector.SmartHosts -join '; ')
UseMXRecord = $connector.UseMXRecord; TlsSettings = $connector.TlsSettings
RuleScoped = $connector.IsTransportRuleScoped
TestMode = $connector.TestMode; Validated = $connector.IsValidated
Changed = $connector.WhenChanged
}
}
})
if ($inbound.Count + $outbound.Count -eq 0) {
Write-Output 'The tenant has no inbound or outbound connectors.'
} else {
$inbound | Sort-Object Name |
Export-Csv -Path './inbound-connectors.csv' -NoTypeInformation -Encoding utf8
$outbound | Sort-Object Name |
Export-Csv -Path './outbound-connectors.csv' -NoTypeInformation -Encoding utf8
Write-Output "$($inbound.Count) inbound and $($outbound.Count) outbound connectors."
}
} finally {
Disconnect-ExchangeOnline -Confirm:$false
}Each CSV has 1 row for each connector, with the domains, addresses and hosts joined by semicolons. To keep more settings, add properties to either [pscustomobject]; to read 1 connector in full, pass its name to Get-InboundConnector or Get-OutboundConnector and pipe it to Format-List.
Option 2
Review connectors in the admin centre
- Open the Exchange admin centre for the correct tenant.
- Go to Mail flow > Connectors. The list includes connectors created by the Hybrid Configuration Wizard or with PowerShell.
- Select a connector to open its details and read its status, where mail comes from and goes to, and its security settings.
- Read the validation history for a connector that carries mail out of Microsoft 365.
- Close the details without choosing Validate this connector or Edit name or status: validating sends a test message, and editing changes the connector.
This suits checking 1 or 2 connectors in a tenant you already have open. For a record to keep and compare, or to be sure no test mode connector is missed, use PowerShell or a report.
Option 3 ยท Recommended for recurring reviews
Run Altivane's Connectors report
- Open Altivane and choose the tenant.
- Run the Connectors report for Exchange Online.
- Open the Excel workbook and read Inbound connectors and Outbound connectors, each with its Status and Reason.
- Run the Remote Domains report next for how mail to other domains is treated, forwarding included.
Altivane reads the test mode and rule scoped outbound connectors as well, and names any it could not read on the workbook's Not read sheet. It flags inbound connectors that treat mail as internal, so it skips spam filtering, and partner connectors that neither require TLS nor restrict senders. Outbound connectors are flagged when TLS isn't required, when they are not validated or when they are in test mode, and a disabled connector in either list is marked for review.
Contact usCommon questions
Why does the export have an outbound connector the list did not show?
The script asks for connectors in test mode and connectors scoped to mail flow rules, which Get-OutboundConnector leaves out unless asked. A rule scoped connector is used only when a mail flow rule routes mail to it.
Do I need a connector to send mail to the internet?
No. Mail between Exchange Online mailboxes and internet addresses needs no connector. Connectors are for mail to and from your own email servers or a partner organisation that needs specific settings.
Which mail flow rules use a connector?
A rule names its outbound connector with RouteMessageOutboundConnector. To export every rule with its actions, see how to export mail flow rules in Exchange Online.
Microsoft references
Technical references checked on 6 November 2026. The example scripts have been reviewed and syntax checked; they have not been run against a live tenant.