Adding IP addresses to Exchange Connectors with powershell

Home to atthedatacenter.com

I needed to add over 100 IP addresses to an internal relay connector. Here’s what I did.

Created a file with all of the addresses. One address per line.

$rc = Get-ReceiveConnector -Identity “tokp3hub31Internal Anonymous AppDevice Relay”
Get-Content c:scriptsIP.txt | foreach {$rc.RemoteIPRanges += “$_”}
$rc | Set-ReceiveConnector -ErrorAction SilentlyContinueThis will append to existing addresses.

I also wanted to run a report of what addresses where associated with the connector, but the output kept getting cut off. I figure out how to Prevent Truncation of Long Output in the exchange management shell. First run:

$FormatEnumerationLimit =-1

then the following will get the total list of IP addresses.

Get-ReceiveConnector “E2K7VInternal Anonymous AppDevice Relay” | fl remoteipranges > c:iplist.txt

Hope it helps

dw

Home to atthedatacenter.com

Advertisements

One thought on “Adding IP addresses to Exchange Connectors with powershell

  1. This is the right site for everyone who wants to understand this topic.

    You understand so much its almost hard to argue with you (not that I
    really will need to…HaHa). You certainly put a brand new
    spin on a topic that’s been written about for ages. Wonderful stuff, just great!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s