Photo by Anthony Shkraba on Pexels.com

Remove Multiple IPs to a Receive Connector Remote IP Range

  • Copy list of IPs to file named IP.txt on your desktop, There is no header needed for the file.
  • Launch Exchange Powershell and run below code.
$ip = Get-Content $home\desktop\ip.txt
foreach ($eachline in $ip)
{
write-host "Removed IP $eachline from Receive Connector"
# replace receive connector with the valida receive connector name.
$RecvConn = Get-ReceiveConnector "Exch1\Authorized Connector"
$RecvConn.RemoteIPRanges -= $eachline
Set-ReceiveConnector "Exch1\Authorized Connector" -RemoteIPRanges $RecvConn.RemoteIPRanges
}

Add Multiple IPs to a Receive Connector Remote IP Range

  • Copy list of IPs to file named IP.txt on your desktop, There is no header needed for the file.
  • Launch Exchange Powershell and run below code.
$ip = Get-Content $home\desktop\ip.txt
foreach ($eachline in $ip)
{
write-host "Removed IP $eachline from Receive Connector"
# replace receive connector with the valida receive connector name.
$RecvConn = Get-ReceiveConnector "Exch1\Authorized Connector"
$RecvConn.RemoteIPRanges += $eachline
Set-ReceiveConnector "Exch1\Authorized Connector" -RemoteIPRanges $RecvConn.RemoteIPRanges
}

Thank you for visiting !

Advertisement