Exchange receive connectors add IP addresses

This post is also available in: Polish

When we need to add IP address to existing Receive Connector we can add it using Exchange Management Console in Server Configuration, Hub Transport.

This solution is fast when you need to add few IP addresses.
But if you need to add many IP addresses then better option is to use Exchange Management Console and Powershell

 

To get list of Receive Connectors we can run command:

Get-ReceiveConnector

We will get list of all Receive Connectors available on all HUB Transport Exchange Servers.

If we want to list Receive Connectors available on specified server then we need to add parameter -server like below:

Get-ReceiveConnector -server ServerName

 

Now we have list of Receive Connectors, we need to check Identity from this list to use it to get list of all IP addresses assigned to Receive Connector.

Run following command to get all IP addresses from Receive Connector:

(Get-ReceiveConnector -identity "servername\receiveconnector_name").RemoteIPRanges

We can save this list as a backup.

 

Add IP addresses to existing Receive Connector:

To add IP address to existing Receive Connector we can use following command:

Set-ReceiveConnector -identity "servername\receiveconnector_name" -RemoteIPRanges 10.0.0.11

 

But now we can see that we’ve overwritten all of the previous IP addresses, and now we have only 10.0.0.11.

 

So to add IP addresses without overwrite existing addresses, we need to modify this command.
Fist we should save all new IP addresses in to a file like IP.txt

Next we need to run following commands to get all new IP addresses from file and add them to Receive Connector:

$ReceiveConnector = Get-ReceiveConnector "servername\receiveconnector_name"
Get-Content D:\scripts\IP.txt | foreach {$ReceiveConnector.RemoteIPRanges += "$_"}
Set-ReceiveConnector "servername\receiveconnector_name" -RemoteIPRanges $ReceiveConnector.RemoteIPRanges

 

Now all new IP addresses are added to existing IP addresses to Receive Connector.

 

 

Print Friendly
Tagged , , , , . Bookmark the permalink.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>