07 October 2013

Export Receive connector RemoteIpRanges

Backing up your Receive connector RemoteIpRanges seem like a good idea, to me at least.
We currently have several hundred ip addresses added to our relay connector.

Losing all that work by some(ones) mistake would take a lot of work to recreate.

So here's how to do it:

First set your output higher, otherwise more than 16 ip addresses added to your connector will be truncated in the powershell output.
[PS] C:\>Get-ReceiveConnector "Relay Connector" | fl remoteipranges

RemoteIPRanges : {,,,,, 10.0.0
                 .16,,,,,, 10.0.
As you can see the ...} at the end of the output means there's more than Powershell shows.

To unlimit the output for your current Powershell session:
$FormatEnumerationLimit =-1

Now we can list all the output to a file:
[PS] C:\>Get-ReceiveConnector "sr-XXXXX\smtp relay" | fl remoteipranges
 | out-file "d:\temp\smtp relay sr-XXXX.txt"
This file can be edited to your needs.

No comments:

Post a Comment