Windows Server 2012 will reach the official End-of-Life (EOL) with Microsoft on 10 October 2023 and Microsoft will cease support for this product. The following instructions were correct at time of writing, however, as these versions are nearing the end of official support, we cannot guarantee the success of configuration.
Using this powershell script will allow the restriction of incoming traffic on a windows-based email server. This script, once configured is recommended to use via the Windows Task Scheduler and to run this script once per hour.
For local cloud users, the same script can be used. However, there is a requirement to edit the script to use your current delivery hostname.