Last active
October 7, 2020 12:26
-
-
Save mardahl/8e22c5ca71f95cb616a45f0db36bc78c to your computer and use it in GitHub Desktop.
Create exchange send connector for relaying through exchange online protection
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This script will create a send connector that can relay through exchange online protection in Office 365 | |
#Must be run from the on prem Exchange Management Shell | |
#WARNING: This will use the wildcard * for sending, so please consider changing "addressSpaces" to some testing domains, so you know this works before routing everything. | |
#WARNING: You must remove your existing internet send connector if you wish for this to work with 100% of all email. | |
#Author: @michael_mardahl (github.com/mardahl) | |
#License: MIT - please keep author credits. | |
$hybridConnector = Get-SendConnector *365* | |
$smartHost = Resolve-DnsName $hybridConnector.AddressSpaces.Address -Type MX | |
New-SendConnector -Name EOP-Smarthost -AddressSpaces * -CloudServicesMailEnabled $true -Fqdn $hybridConnector.Fqdn -RequireTLS $true -DNSRoutingEnabled $false -SmartHosts $smartHost.NameExchange -TlsAuthLevel CertificateValidation -Usage Internet -TlsCertificateName $hybridConnector.TlsCertificateName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment