How to disable antimalware on Exchange 2016

To disable malware filtering on the local Mailbox server, run this command in the Exchange Management Shell:
& $env:ExchangeInstallPath\Scripts\Disable-AntimalwareScanning.ps1

To enable malware filtering on the local Mailbox server, run this command in the Exchange Management Shell:
& $env:ExchangeInstallPath\Scripts\Enable-AntimalwareScanning.ps1

If the command was successful, you see this message:

Anti-malware scanning is successfully . Please restart MSExchangeTransport for the changes to take effect.

Note: The enable script also applies malware engine and definition updates as needed.

Restart the Exchange Transport service by running this command, which will temporarily interrupt mail flow on the server:

Restart-Service MSExchangeTransport
The change might take up to 10 minutes to take effect.