Monday, May 7, 2012

Update IPs on Receive Connectors

If you have multiple HUB servers and ever had to update one or more IP addresses from a custom Receive Connector, you know how much work it is involved. Especially if you have to do this often.
If this is your case, here’s how you can easily remove (or add) IPs from a receive connector across all your HUB servers:
# Get Receive Connectors to update
$recCons = Get-ReceiveConnector | Where {$_.Name -match "Unauthenticated SMTP"}

ForEach ($recCon in $recCons)
{
   Write-Host "Updating", $recCon.Identity

   $recCon.RemoteIPRanges -= "10.101.74.10"
   $recCon.RemoteIPRanges -= "10.102.34.12"

   Set-ReceiveConnector $recCon -RemoteIPRanges $recCon.RemoteIPRanges
}
Hope this helps!

No comments:

Post a Comment