Exchange 2010 Receive Connectors and Powershell

To dump them to a file:

$FormatEnumerationLimit =-1
Get-ReceiveConnector “” | fl remoteipranges > c:\scripts\iplist.txt

And to import them from a file:

$rc = Get-ReceiveConnector -Identity “
Get-Content "c:\scripts\addrelayips.txt" | foreach {$rc.RemoteIPRanges += "$_"}
Set-ReceiveConnector "" -RemoteIPRanges $rc.RemoteIPRanges

This *will* append to any IP’s existing in the list already.

Leave a Reply

Your email address will not be published. Required fields are marked *