Script to add IP address in Recieve Connector on edge servers

Manish Kumar
Manish Kumar used Ask the Experts™
on
Hello Everybody,

I need to add different IP addresses of any application server under Receive Connector->Networks tab by a script.
I have 6 edge servers and i want to add it by a script on all server at once.

I have also attached the screenshots for ref as well

I know how to add it by logging into one by one on all servers.
Please let me know the way to do it on all edge servers at once

Details
Exchange server 2010 sp3
MBX-server -8
CAS/HUB-4
Edge-server-6
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
StuartTechnical Architect - Cloud

Commented:
I use the following that references a text file with a list of internal IP addresses

$RecvConn = Get-ReceiveConnector "internal_relay"
Get-Content .\RemoteIP.txt | foreach {$RecvConn.RemoteIPRanges += "$_"}
Set-ReceiveConnector "internal_relay" -RemoteIPRanges $RecvConn.RemoteIPRanges

Presuming your connectors are named the same you could run this OR wild card the command where required
StuartTechnical Architect - Cloud

Commented:
Example to wildcard the command to suit your environment

$RecvConn = Get-ReceiveConnector "*int*"
Get-Content .\RemoteIP.txt | foreach {$RecvConn.RemoteIPRanges += "$_"}
Set-ReceiveConnector -RemoteIPRanges $RecvConn.RemoteIPRanges

Dont forget to have the remoteip.txt file int he directory that you run this in OR insert the full path
Manish KumarSr. Technical Consultant

Author

Commented:
will this script add ip adress to all edge servers at once or I have to run ir on every server ony by one
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Gaurav SinghSolutions Architect

Commented:
you will need to run this script on all edge servers to add the IPs.
StuartTechnical Architect - Cloud

Commented:
Sorry I missed your comment Manish yes the above is correct you need to run this on each one
Manish KumarSr. Technical Consultant

Author

Commented:
@Gaurav adn @Stuart
Thank you for confirmation. I need it a script which will run from one server.
I know edge servers are in DMZ but still with the help of IP of all edge servers can it be possible?
Technical Architect - Cloud
Commented:
You would just edit the script to remote powershell to each server one by one, I'm out at the moment so won't be able to get anything written down for you until later poss tomorrow

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial