Adding O365 & EOP IPs to Exchange Receive Connector

2017-12-11T16:12:05+00:00 March 30th, 2015|Azure, Office 365|

As my colleague pointed out earlier there have been some new additions to the IP list for O365, if you are like us and keep a tight hold on the IPs allowed to speak to your Exchange receive connectors this can involve a lengthy process of adding these IPs individually. However there is a command you can run, although be aware this replaces everything in the current connector – it does not add.

To get the current IPs in the connector run:

Get-ReceiveConnector -Identity “SERVERNAMECONNECTORNAME” | select -ExpandProperty RemoteIpRanges | select expression | Out-File c:current.txt

This will give you a nice little text file list of all the IPs.

Alternatively you can grab the IPs from the O365 website (remember to get the EOP ones too if you use it):

Should you wish to just add these ones, heres the command to replace your current connectors IPs:

Set-ReceiveConnector -Identity “SERVERNAMECONNECTORNAME” –RemoteIPRanges,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,

Unfortunately to get the command into the post i had to add some new lines so just delete carriage returns in the above.

Alternatively grab the list from your text file and just add the new ones!

Hope it helps!