Link to home
Create AccountLog in
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
Avatar of Stuart
Stuart
Flag of United Kingdom of Great Britain and Northern Ireland image

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
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
Avatar of Manish Kumar
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
Avatar of Gaurav Singh
you will need to run this script on all edge servers to add the IPs.
Sorry I missed your comment Manish yes the above is correct you need to run this on each one
@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?
ASKER CERTIFIED SOLUTION
Avatar of Stuart
Stuart
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer