Add multiple IP’s to Exchange Receive Connector CLI

Return the list of IP’s from the connector:

Get-ReceiveConnector “Relay Connector” | fl RemoteIPRanges

Add a single IP address to the Connector. We pull the list of existing IP’s and append the new IP and then add the entire list back.

$RecvConn = Get-ReceiveConnector “Relay Connector”

$RecvConn.RemoteIPRanges += “10.0.0.99”

Set-ReceiveConnector “Relay Connector” -RemoteIPRanges $RecvConn.RemoteIPRanges

Read a list of IP’s from a text file.

$RecvConn = Get-ReceiveConnector “Relay Connector”

Get-Content .\IPList.txt | foreach {$RecvConn.RemoteIPRanges += “$_”}

Set-ReceiveConnector “Relay Connector” -RemoteIPRanges $RecvConn.RemoteIPRanges

Return a list of IP’s configured on the connector. Expand the entire list.

Get-ReceiveConnector “Default SHRSRVEXCH01″ | Select -ExpandProperty RemoteIPRanges

 
 

Thanks! ITKB

1 Comment

  1. Kory

    Dear Mustafa,

    you did not show an example of the IPList.txt. How does it has to be formated?

    Reply

Leave a Comment

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