Install / Uninstall Anti-Spam in Exchange 2007

In Exchange 2003 the Anti-Spam system is part of the exchange installation and can be enabled or disabled by marking the relevant component on the SMTP Virtual Server: https://petri.com/block_spam_with_exchange_2003.htm

Exchange 2007 is built differently and a new element called Edge was added in order to handle Spam and Viruses, and because of this the traditional Anti-spam system is not installed as a default during the Exchange 2007 installation.
When you are not installing the Edge server role as a mailrelay, but you still want to use the Anti-Spam system that that is part of Exchange 2007, you need to install it from a PowerShell script that was installed during the Exchange 2007 installation on the Hub transport role. To do this, follow the instructions listed below.

Installing Exchange 2007 Anti-spam system

  1. Close the EMC (Exchange Management Console).
  2. Open the PowerShell and navigate using the following path: “Program Files\Microsoft\Exchange Server\Scripts“.
  3. Run the “install-AntispamAgents.ps1” script as shown in window (with ./ before the script name) below: antispam 01 small
  4. Restart the “Microsoft Exchange Transport” service in order to apply configuration changes.
  5. Open the Exchange Management Console, and on the Organization configuration list, select Hub Transport. The “Anti-Spam” tab has been added to the Hub Transport properties. antispam 02 small

Uninstalling Exchange 2007 Anti-spam system

If from some reason, you would like to uninstall the Anti-Spam system from the Hub Transport role, follow the next steps:

  1. Close the EMC (Exchange Management Console).
  2. Open the PowerShell and navigate using the following path: “Program Files\Microsoft\Exchange Server\Scripts“.
  3. Run the “uninstall-AntispamAgents.ps1” script as shown in window (with ./ before the script name) below: Note: You will be prompt to disable and then uninstall each agent of the Anti-spam system like the Connection filtering, content filter, Sender filtering etc. antispam 03 small
  4. Restart the “Microsoft Exchange Transport” service in order to apply configuration changes.
  5. Open the Exchange Management Console, and on the Organization configuration list, select Hub Transport. You will see that the “Anti-Spam” tab has been removed from the Hub Transport properties. antispam 04 small