Step-by-step guide to configure the Exchange Online connector using PowerShell.
You need Exchange Administrator or Global Administrator permissions in Microsoft 365.
Open PowerShell as Administrator and install the Exchange Online Management module:
Install-Module ExchangeOnlineManagement -Scope CurrentUser -Force
Import-Module ExchangeOnlineManagement
Connect-ExchangeOnline -UserPrincipalName [email protected]
A browser window will open for Microsoft authentication. Sign in with your admin account.
This routes all outbound mail through the Badex Signature server:
New-OutboundConnector `
-Name "Badex Signature Outbound" `
-ConnectorType Partner `
-SmartHosts "smtp.signature.badex.app" `
-UseMXRecord $false `
-TlsSettings Opportunistic `
-RecipientDomains "*" `
-Enabled $true
This prevents signature loops — emails already processed won't be processed again:
New-TransportRule `
-Name "Badex Signature Route" `
-FromScope InOrganization `
-RouteMessageOutboundConnector "Badex Signature Outbound" `
-ExceptIfHeaderContainsMessageHeader "X-BADEX-Signature-Processed" `
-ExceptIfHeaderContainsWords "1" `
-StopRuleProcessing $true
# Check connector
Get-OutboundConnector -Identity "Badex Signature Outbound" | Format-List Name, Enabled, SmartHosts
# Check transport rule
Get-TransportRule -Identity "Badex Signature Route" | Format-List Name, State, Mode
Expected output:
Name : Badex Signature Outbound
Enabled : True
SmartHosts : {smtp.signature.badex.app}
Name : Badex Signature Route
State : Enabled
Mode : Enforce
Send a test email from any mailbox in your organization to an external address. Check the email headers to verify:
X-BADEX-Signature-Processed: 1 is presentDKIM-Signature header existsTo remove Badex Signature and restore normal mail flow:
Remove-OutboundConnector -Identity "Badex Signature Outbound" -Confirm:$false
Remove-TransportRule -Identity "Badex Signature Route" -Confirm:$false
Go to Microsoft 365 → your tenant → Connector Script to get a pre-filled script with your exact domain and settings.