PowerShell Genie

Connector inventory

Script 2 min read Windows PowerShell 5.1 and PowerShell 7

Documentation: Microsoft Learn

Inventory Exchange Online inbound and outbound connectors, including enabled state, connector type, and outbound recipient domains.

The script

1PS> Get-InboundConnector | Select-Object Name,Enabled,ConnectorType; Get-OutboundConnector | Select-Object Name,Enabled,RecipientDomains

Script reader

Inspect before you run

Inspection only

Inspect the script below. It does not run in this browser.

Inspection only — no command has run.

    Show reference output
    1 Name Enabled ConnectorType
    2 ---- ------- -------------
    3 Inbound from Contoso True Partner
    4
    5 Name Enabled RecipientDomains
    6 ---- ------- ----------------
    7 Outbound to Fabrikam True {fabrikam.example}
    Inspect this example’s structure

    Read the command and its supplied arguments. This example requires real PowerShell or its module; this diagram does not execute it.

    Get-InboundConnector | Select-Object Name,Enabled,ConnectorType; Get-OutboundConnector | Select-Object Name,Enabled,RecipientDomains
    1. Stage 1Get-InboundConnectorPositional values or no named parameters
    2. Stage 2Select-ObjectPositional values or no named parameters
    3. Stage 3Select-ObjectPositional values or no named parameters

      How it works

      Two calls run back to back. Get-InboundConnector reports each inbound connector with its enabled state and ConnectorType, which says whether it was built for on-premises or partner mail, and Get-OutboundConnector adds the RecipientDomains each outbound connector claims responsibility for.

      Adapting it

      Add SmartHosts to the outbound projection and TlsSenderCertificateName to the inbound one, because those fields are where a certificate rotation on either side quietly breaks delivery.

      Requirements

      ExchangeOnlineManagement module with a Connect-ExchangeOnline session.

      If the result is unexpected

      Connector inventory does not explain a mail-flow failure.

      Inbound and outbound connectors have different direction, matching and transport settings.

      1. Identify the message direction and compare its route with the relevant connector configuration.

      Validate the result

      The inspected connector matches the intended route and its validation results are recorded.

      Keep the check reliable

      Keep connector direction, domains and transport requirements in the inventory.

      Primary documentation

      Active Directory PowerShell documentation

      Continue
      Genie guideConnector inventory

      Inventory Exchange Online inbound and outbound connectors, including enabled state, connector type, and outbound recipient domains.