Remove/Add Multiple IPs to/from a Receive Connector’s Remote IP Range

 

https://learntechfuture.com/2021/01/16/remove-add-multiple-ips-to-from-a-receive-connectors-remote-ip-range/#:~:text=Remove%20Multiple%20IPs%20to%20a,Thank%20you%20for%20visiting%20!

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.
1
2
3
4
5
6
7
8
9
$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.
1
2
3
4
5
6
7
8
9
$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 !

Комментарии

Популярные сообщения из этого блога

У вас нет прав для отправки сообщения вместо указанного пользователя. Ошибка: [0x80070005-0x0004dc-0x000524]

Пустое значение виртуального каталога Autodiscover - Object reference not set to an instance of an object (Get-AutodiscoverVirtualDirectory)

KSMG Подготовка конфигурационных файлов для подключения к LDAP