Avatar of Manish Kumar
Manish Kumar
 asked on

Script to add IP address in Recieve Connector on edge servers

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
ExchangeEmail Servers

Avatar of undefined
Last Comment
Stuart

8/22/2022 - Mon
Stuart

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
Stuart

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 Kumar

ASKER
will this script add ip adress to all edge servers at once or I have to run ir on every server ony by one
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck
Systech Admin

you will need to run this script on all edge servers to add the IPs.
Stuart

Sorry I missed your comment Manish yes the above is correct you need to run this on each one
Manish Kumar

ASKER
@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?
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
Stuart

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.