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
LVL 1
Manish KumarSr. Technical ConsultantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

StuartTechnical Architect - CloudCommented:
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
1
StuartTechnical Architect - CloudCommented:
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
1
Manish KumarSr. Technical ConsultantAuthor 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
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

systechadminConsultantCommented:
you will need to run this script on all edge servers to add the IPs.
0
StuartTechnical Architect - CloudCommented:
Sorry I missed your comment Manish yes the above is correct you need to run this on each one
0
Manish KumarSr. Technical ConsultantAuthor 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?
0
StuartTechnical Architect - CloudCommented:
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
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.