Here are a Couple of useful commands to assist in Exchange migrations when a complex list of entries are in the Scope of SMTP relay connectors on existing Exchange Servers.  This is basically to ‘fork-lift’ the entire set of entries on an SMTP Connector.  This will copy across individual addresses and ranges.

On the New Exchange Server Create a FrontEnd Transport Connector with a single IP Address from the range already declared on Legacy Server SMTP connector.  This just puts the connector in place, so we can write the data to it via Exchange Powershell

Set-ReceiveConnector ”NewExchangeServer\SMTPRelay” -RemoteIPRanges ( Get-ReceiveConnector “LegacyExchangeServer\SMTPRelay” ).RemoteIPRanges

This command will overwrite anything that exists in the SMTPRelay Connector

If I am adding a single address to a connector, then I’d probably use the GUI.

However, if you want to use PowerShell to add a single address

$RecCon = Get-Receiveconnector “NewExchangeServer\SMTPRelay”

$RecCon.RemoteIPRanges += “10.0.0.100”

Set-RecieveConnector “NewExchangeServer\SMTPRelay” -RemoteIPRanges $RecCon.RemoteIPRanges

If you want to add multiple addresses via PowerShell

$RecCon = Get-Receiveconnector “NewExchangeServer\SMTPRelay”

$RecCon.RemoteIPRanges += “10.0.0.100”, “10.0.0.101”, “10.0.0.102”

Set-RecieveConnector “NewExchangeServer\SMTPRelay” -RemoteIPRanges $RecCon.RemoteIPRanges