More about AMSI integration with Exchange Server

Published Jul 22 2021 07:00 AM 18.8K Views

The Windows Antimalware Scan Interface (AMSI) is a versatile standard that allows applications and services to integrate with any antimalware product present on a machine. AMSI is vendor agnostic and designed to allow for the most common malware scanning and protection techniques provided by today's products to be integrated into applications.

Seeing that Exchange administrators might not be familiar with AMSI, we wanted to provide an overview of various components that make this work, because…

Exchange Server integration arrives

As of the June 2021 quarterly updates, Exchange Server supports integration with AMSI. This provides the ability for an AMSI-capable antivirus/antimalware solution to scan content in HTTP requests sent to the Exchange Server and block a malicious request before it is handled by Exchange. The scan is performed in real-time as the server begins to process the request. AMSI, as implemented in June 2021 Cumulative Updates (CUs), only scans the HTTP protocol, and is not meant to be a replacement to existing server-level or message hygiene protections.

There is no observed performance impact from AMSI scanning when tested with Microsoft Defender and no changes to be made to the existing documented Exchange Sever antivirus exclusions. Each antivirus provider develops their own definitions that utilize AMSI technology, therefore your level of protection remains dependent on how quickly your specific solution can be dynamically updated to detect the latest threats.

The following steps will help you understand a bit more about what is needed on each of the Exchange servers to ensure that AMSI Integration is enabled and working:

AMSI integration with Exchange Server prerequisites

To start let’s make sure our Exchange Server can even support AMSI integration. Check the following prerequisites on each server:

  • Windows Server 2016, or higher
  • Exchange Server 2016 CU21 / Exchange Server 2019 CU10, or higher
  • Microsoft Defender with AV engine version at or higher than 1.1.18300.4 (alternatively, a compatible AMSI capable third-party AV provider – please check with your vendor)

How to find your installed AMSI provider

Now that you have met the prerequisites let’s confirm that you have an AMSI provider installed on the server. To do so you will need to run the following Windows PowerShell commands and review the output:

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\AMSI\Providers' -recurse
Get-ChildItem 'HKLM:\SOFTWARE\Classes\CLSID\{GUID obtained from previous command}'

For example, you can set a variable and then search for the RegEx Results of all AMSI Providers installed by running:

$AMSI = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\AMSI\Providers' -Recurse
$AMSI -match '[0-9A-Fa-f\-]{36}'
$Matches.Values | ForEach-Object {Get-ChildItem "HKLM:\SOFTWARE\Classes\CLSID\{$_}" | Format-Table -AutoSize}

For example:

Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
C:\PowerShell> $AMSI = Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\AMSI\Providers' -Recurse
C:\PowerShell> $AMSI -match '[0-9A-Fa-f\-]{36}'
C:\PowerShell> $Matches.Values | ForEach-Object {Get-ChildItem "HKLM:\SOFTWARE\Classes\CLSID\{$_}" | Format-Table -AutoSize}

Hive: HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{2781761E-28E0-4109-99FE-B9D127C57AFE}

Name Property
---- --------
Hosts (default) : Scanned Hosting Applications
Implemented Categories
InprocServer32 (default) : "C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2106.6-0\MpOav.dll"
ThreadingModel : Both

The results show us that the only provider we have installed is in C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2106.6-0\MpOav.dll which is Microsoft Windows Defender. So now we know that the Windows 2016 operating system or higher sees our AMSI Provider installation.

Web.config files

Next for AMSI Integration to work correctly we need to make sure that the HttpRequestFilteringModule line below is present in the <Modules> section of the FrontEnd and ClientAccess web.config files:

<add name="HttpRequestFilteringModule" type="Microsoft.Exchange.HttpRequestFiltering.HttpRequestFilteringModule, Microsoft.Exchange.HttpRequestFiltering, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />

If you make a habit of replacing web.config files, you need to make sure that you have this line or AMSI will not work properly.

Confirm your Windows Defender version via the command line

If you are using Microsoft Windows Defender jump into the command line and make sure you have updated the signatures to the latest version.

  1. Launch Command Prompt as an administrator
  2. Navigate to C:\ProgramData\Microsoft\Windows Defender\Platform\<antimalware platform version>
  3. Run mpcmdrun.exe -SignatureUpdate. This will check for the latest definitions and report your current engine version.

Microsoft Windows Command Prompt
Copyright (C) Microsoft Corporation. All rights reserved.
C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2105.5-0>MpCmdRun.exe -SignatureUpdate
Signature update started . . .
Service Version: 4.18.2106.6
Engine Version: 1.1.18300.4
AntiSpyware Signature Version: 1.343.1364.0
AntiVirus Signature Version: 1.343.1364.0
Signature update finished. No updates needed
C:\ProgramData\Microsoft\Windows Defender\Platform\4.18.2105.5-0>

Confirm that AMSI integration is working

If any request is detected to be malicious by the AMSI module it is logged in the %ExchangeInstallPath%\Logging\HttpRequestFiltering folder and the value for ScanResult is “Detected”. This module does not create logs for safe calls so, if a log is present then a malicious call was seen at some point. When a request get blocked IIS will issues return code 400 / Bad Request back to the requestor.

Once a malicious connection is detected the log will look something like this:

DateTime,MajorVersion,MinorVersion,BuildVersion,RevisionVersion,ServerHostName,SharedCacheLatency,TotalLatency,HttpMethod,UrlHost,UrlStem,UrlQuery,ServerIP,Protocol,HeaderNames,CookieNames,ScanResult,GenericInfo,GenericErrors
#Software: Microsoft Exchange Server
#Version: 15.01.build
#Log-type: Http Request Filtering Logs
#Date: 2021-06-30T10:03:57.573Z
#Fields:
DateTime,MajorVersion,MinorVersion,BuildVersion,RevisionVersion,ServerHostName,SharedCacheLatency,TotalLatency,HttpMethod,UrlHost,UrlStem,UrlQuery,ServerIP,Protocol,HeaderNames,CookieNames,ScanResult,GenericInfo,GenericErrors
6/30/2021 10:03:57 AM,15,1,2334,0,SERVER01,,,POST,localhost,/ecp/x.js,,::1,FrontEnd.Ecp,Content-Length;Cookie;Host,X-BEResource,Detected,,
6/30/2021 10:09:41 AM,15,1,2334,0,SERVER01,,,POST,SERVER01.contoso.com,/ecp/x.js,,192.168.10.52,FrontEnd.Ecp,Content-Length;Cookie;Host,X-BEResource,Detected,,
6/30/2021 10:09:43 AM,15,1,2334,0,SERVER01,,,POST,SERVER01.contoso.com,/ecp/x.js,,192.168.10.52,FrontEnd.Ecp,Content-Length;Cookie;Host,X-BEResource,Detected,,

How to disable AMSI integration with Exchange Server

If for some reason you need to temporarily disable the AMSI integration for testing or troubleshooting purposes. You can do so by opening Exchange Management Shell and create a new server override:

Welcome to the Exchange Management Shell!
[PS] C:\PowerShell> New-SettingOverride -Name "DisablingAMSIScan" -Server ServerName -Component Cafe -Section HttpRequestFiltering -Parameters ("Enabled=False") -Reason "Testing"
[PS] C:\PowerShell> Get-ExchangeDiagnosticInfo -Process Microsoft.Exchange.Directory.TopologyService -Component VariantConfiguration -Argument Refresh
[PS] C:\PowerShell> Restart-Service -Name W3SVC, WAS -Force

Note: If you set the override without using the -Server parameter, the override applies to all Exchange 2016/2019 servers in the forest.

Once your testing is complete, re-enable the AMSI integration by removing the setting override:

Welcome to the Exchange Management Shell!
[PS] C:\PowerShell> Remove-SettingOverride -Name "DisablingAMSIScan" -Component Cafe -Section HttpRequestFiltering -Parameters ("Enabled=False") -Reason "Testing"
[PS] C:\PowerShell> Get-ExchangeDiagnosticInfo -Process Microsoft.Exchange.Directory.TopologyService -Component VariantConfiguration -Argument Refresh
[PS] C:\PowerShell> Restart-Service -Name W3SVC, WAS -Force

You will have to restart the Internet Information Services (IIS) on the machine which will disrupt connectivity so make sure to do this when there will be no impact to the server or under a maintenance period.

Self-service test script

The new script we have created will let you test your Exchange Server AMSI integration with Microsoft Defender. The script can send a crafted HTTP request that will trigger the anti-malware scanner and once run you can check the \HttpRequestFiltering folder for a log. The script can also check your AMSI Providers on the system and even enable and disable AMSI integration. The script is available at the CSS-Exchange Repo on GitHub [Test-AMSI]. Please see GitHub for script usage tips / documentation!

Angélique Conde, Rob Whaley

13 Comments
Established Member

On Windows 2016 I dont have a folder "Platform". I have one on Windows 2019. Is it a differnt Path with Windows 2016?

 

 

 

 

 

 

 

 

@Test-RRR Are you sure that you are in ProgramData not Program Files? I have checked all my labs and all of them have the Platform folder. 

Senior Member

Hi Sir
I've ran .\Test-AMSI.ps1 on Exchange 2016 CU21 but get below SSL/TLS connection error. Any idea? 


I'm sure AMSI is running and functional since CU21 upgrade on end of June. I'm keep follow related articles posted by Exchange Team. 

 

Test-AMSI : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
At C:\Batch\AMSI\Test-AMSI.ps1:124 char:1
+ Test-AMSI
+ ~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Test-AMSI

If you are using Microsoft Defender then AMSI may be disabled or you are using a AntiVirus Product that may not be AMSI capable (Please Check with your AntiVirus Provider for Exchange AMSI Support)



Updated how to fixed. 
Add below script in front Function Test-AMSI section. 

function Test-AMSI {


if (-not ([System.Management.Automation.PSTypeName]'ServerCertificateValidationCallback').Type)
{
$certCallback = @"
    using System;
    using System.Net;
    using System.Net.Security;
    using System.Security.Cryptography.X509Certificates;
    public class ServerCertificateValidationCallback
    {
        public static void Ignore()
        {
            if(ServicePointManager.ServerCertificateValidationCallback ==null)
            {
                ServicePointManager.ServerCertificateValidationCallback += 
                    delegate
                    (
                        Object obj, 
                        X509Certificate certificate, 
                        X509Chain chain, 
                        SslPolicyErrors errors
                    )
                    {
                        return true;
                    };
            }
        }
    }
"@
    Add-Type $certCallback
 }
[ServerCertificateValidationCallback]::Ignore()

 

Frequent Visitor

Great Info, thanks.

Now its not a complete black box anymore.

I will extend our monitoring to include those logs!

 

If you have sccm and using endpoint protection on your exchange servers gives great visibility into amsi.

Very nice!

justsomeadmin_0-1627046753459.png

 

 

Established Member

@Rob Whaley (EXCHANGE): Thanks for your answer. Since we use a 3trd part virus scanner in production I tested on Window 2016 in my lab. The updates where missing - after updating Windows the folder "Platform"  is where.

Frequent Visitor

Thanks for the Info!

 

Running the Test-AMSI script on an Exchange server that has a different OS language than English (German in my case) will lead to the warning message that AMSI may be disabled, as the script checks for the English error message of the code 400 / Bad Request that is returned. The test is working fine despite of this, code 400 is returned and the detection is logged. And a Microsoft 365 Defender alert was triggered, as we've onboarded the Exchange servers to Defender for Endpoint. Of course you can change the script and add the error message in the OS language if you want it to display the correct result.

@Johnny_Yao_Taiwan and @Pamor Thanks for your feedback I have added these issues over on GitHub.

Senior Member

Thank you for the information.

 

Is the real-time AMSI scanning of HTTP traffic also working, if the real-time protection of Windows Defender is disabled per

Set-MpPreference -DisableRealtimeMonitoring $true

?

 

Thank you in advance.

Jörg Maletzky

 

 

 

@Jörg Maletzky When real time monitoring is disabled in Microsoft Defender AMSI scanning of traffic will also be disabled. I would suggest that you leave real time monitoring enabled and follow the documentation here: Running Windows antivirus software on Exchange servers | Microsoft Docs to set the proper exclusions. 

Occasional Visitor

I suspect that Sophos and AMSI on our EX2016 server was giving performance issues so I uninstalled Sophos to fully confirm my suspicions.  Message transfer completely broken after the uninstall so Sophos re-installed and all functional again.  Will try the Sophos AMSI disable approach but rather surprised that the uninstall leaves it broken.  

Occasional Contributor

If we have Windows Defender exclusions set (as per official article), it states to also exclude %SystemRoot%\System32\inetsrv path and the w3wp.exe process. If these paths and processes are being excluded, would that cause AMSI integrated protection not to work?

Occasional Visitor

This cmd (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\AMSI\Providers' -recurse) does not return anything on a  2k19 server with exchange 2k19.

After upgrading to Exchange Server 2016 CU21 receiving an error that Microsoft.Exchange.HttpRequestFiltering could not be loaded.  If I comment out the module HttpRequestFilteringModule in the web.config the app will load correctly. The DLL is in the bin folder in the Exchange install location. But any application (OWA, ECO, EWS, etc.) that has the new module won't load. I disabled AMSI with the Test-AMSI script provided here but didn't make a difference. The only way I could get Exchange back online was to remove the references to the HttpRequestFilteringModule from each web.config. 

%3CLINGO-SUB%20id%3D%22lingo-sub-2576230%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2576230%22%20slang%3D%22en-US%22%3E%3CP%3EOn%20Windows%202016%20I%20dont%20have%20a%20folder%20%22Platform%22.%20I%20have%20one%20on%20Windows%202019.%20Is%20it%20a%20differnt%20Path%20with%20Windows%202016%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2580478%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2580478%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F3987%22%20target%3D%22_blank%22%3E%40Rob%20Whaley%20(EXCHANGE)%3C%2FA%3E%3A%20Thanks%20for%20your%20answer.%20Since%20we%20use%20a%203trd%20part%20virus%20scanner%20in%20production%20I%20tested%20on%20Window%202016%20in%20my%20lab.%20The%20updates%20where%20missing%20-%20after%20updating%20Windows%20the%20folder%20%22Platform%22%26nbsp%3B%20is%20where.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2578009%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2578009%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Sir%3CBR%20%2F%3EI've%20ran%20.%5CTest-AMSI.ps1%20on%20Exchange%202016%20CU21%20but%20get%20below%20SSL%2FTLS%20connection%20error.%20Any%20idea%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%3CBR%20%2F%3EI'm%20sure%20AMSI%20is%20running%20and%20functional%20since%20CU21%20upgrade%20on%20end%20of%20June.%20I'm%20keep%20follow%20related%20articles%20posted%20by%20Exchange%20Team.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CU%3E%3CSTRONG%3ETest-AMSI%20%3A%20The%20underlying%20connection%20was%20closed%3A%20Could%20not%20establish%20trust%20relationship%20for%20the%20SSL%2FTLS%20secure%20channel.%3C%2FSTRONG%3E%3C%2FU%3E%0AAt%20C%3A%5CBatch%5CAMSI%5CTest-AMSI.ps1%3A124%20char%3A1%0A%2B%20Test-AMSI%0A%2B%20~~~~~~~~~%0A%2B%20CategoryInfo%20%3A%20NotSpecified%3A%20(%3A)%20%5BWrite-Error%5D%2C%20WriteErrorException%0A%2B%20FullyQualifiedErrorId%20%3A%20Microsoft.PowerShell.Commands.WriteErrorException%2CTest-AMSI%0A%0AIf%20you%20are%20using%20Microsoft%20Defender%20then%20AMSI%20may%20be%20disabled%20or%20you%20are%20using%20a%20AntiVirus%20Product%20that%20may%20not%20be%20AMSI%20capable%20(Please%20Check%20with%20your%20AntiVirus%20Provider%20for%20Exchange%20AMSI%20Support)%3C%2FPRE%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3EUpdated%20how%20to%20fixed.%26nbsp%3B%3CBR%20%2F%3EAdd%20below%20script%20in%20front%20Function%20Test-AMSI%20section.%26nbsp%3B%3C%2FP%3E%3CPRE%3Efunction%20Test-AMSI%20%7B%0A%0A%0Aif%20(-not%20(%5BSystem.Management.Automation.PSTypeName%5D'ServerCertificateValidationCallback').Type)%0A%7B%0A%24certCallback%20%3D%20%40%22%0A%20%20%20%20using%20System%3B%0A%20%20%20%20using%20System.Net%3B%0A%20%20%20%20using%20System.Net.Security%3B%0A%20%20%20%20using%20System.Security.Cryptography.X509Certificates%3B%0A%20%20%20%20public%20class%20ServerCertificateValidationCallback%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20public%20static%20void%20Ignore()%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20if(ServicePointManager.ServerCertificateValidationCallback%20%3D%3Dnull)%0A%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20ServicePointManager.ServerCertificateValidationCallback%20%2B%3D%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20delegate%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20(%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Object%20obj%2C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20X509Certificate%20certificate%2C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20X509Chain%20chain%2C%20%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20SslPolicyErrors%20errors%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20true%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7D%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%22%40%0A%20%20%20%20Add-Type%20%24certCallback%0A%20%7D%0A%5BServerCertificateValidationCallback%5D%3A%3AIgnore()%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2594069%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2594069%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F804488%22%20target%3D%22_blank%22%3E%40Johnny_Yao_Taiwan%3C%2FA%3E%26nbsp%3Band%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F972015%22%20target%3D%22_blank%22%3E%40Pamor%3C%2FA%3E%26nbsp%3BThanks%20for%20your%20feedback%20I%20have%20added%20these%20issues%20over%20on%20GitHub.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2595418%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2595418%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you%20for%20the%20information.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20the%20real-time%20AMSI%20scanning%20of%20HTTP%20traffic%20also%20working%2C%20if%20the%20real-time%20protection%20of%20Windows%20Defender%20is%20disabled%20per%3C%2FP%3E%3CP%3E%3CEM%3ESet-MpPreference%20-DisableRealtimeMonitoring%20%24true%3C%2FEM%3E%3C%2FP%3E%3CP%3E%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20in%20advance.%3C%2FP%3E%3CP%3EJ%C3%B6rg%20Maletzky%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2595772%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2595772%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F67131%22%20target%3D%22_blank%22%3E%40J%C3%B6rg%20Maletzky%3C%2FA%3E%26nbsp%3BWhen%20real%20time%20monitoring%20is%20disabled%20in%20Microsoft%20Defender%20AMSI%20scanning%20of%20traffic%20will%20also%20be%20disabled.%20I%20would%20suggest%20that%20you%20leave%20real%20time%20monitoring%20enabled%20and%20follow%20the%20documentation%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2FExchange%2Fantispam-and-antimalware%2Fwindows-antivirus-software%3Fview%3Dexchserver-2019%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ERunning%20Windows%20antivirus%20software%20on%20Exchange%20servers%20%7C%20Microsoft%20Docs%3C%2FA%3E%26nbsp%3Bto%20set%20the%20proper%20exclusions.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2608770%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2608770%22%20slang%3D%22en-US%22%3E%3CP%3EI%20suspect%20that%20Sophos%20and%20AMSI%20on%20our%20EX2016%20server%20was%20giving%20performance%20issues%20so%20I%20uninstalled%20Sophos%20to%20fully%20confirm%20my%20suspicions.%26nbsp%3B%20Message%20transfer%20completely%20broken%20after%20the%20uninstall%20so%20Sophos%20re-installed%20and%20all%20functional%20again.%26nbsp%3B%20Will%20try%20the%20Sophos%20AMSI%20disable%20approach%20but%20rather%20surprised%20that%20the%20uninstall%20leaves%20it%20broken.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2628642%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2628642%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20we%20have%20Windows%20Defender%20exclusions%20set%20(as%20per%20official%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2FExchange%2Fantispam-and-antimalware%2Fwindows-antivirus-software%3Fview%3Dexchserver-2019%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%22%3Earticle%3C%2FA%3E)%2C%20it%20states%20to%20also%20exclude%20%3CSTRONG%3E%25SystemRoot%25%5CSystem32%5Cinetsrv%3C%2FSTRONG%3E%20path%20and%20the%26nbsp%3B%3CSTRONG%3Ew3wp.exe%3C%2FSTRONG%3E%20process.%20If%20these%20paths%20and%20processes%20are%20being%20excluded%2C%20would%20that%20cause%20AMSI%20integrated%20protection%20not%20to%20work%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2593883%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2593883%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%20for%20the%20Info!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERunning%20the%20Test-AMSI%20script%20on%20an%20Exchange%20server%20that%20has%20a%20different%20OS%20language%20than%20English%20(German%20in%20my%20case)%20will%20lead%20to%20the%20warning%20message%20that%20AMSI%20may%20be%20disabled%2C%20as%20the%20script%20checks%20for%20the%20English%20error%20message%20of%20the%20code%20400%20%2F%20Bad%20Request%20that%20is%20returned.%20The%20test%20is%20working%20fine%20despite%20of%20this%2C%20code%20400%20is%20returned%20and%20the%20detection%20is%20logged.%20And%20a%20Microsoft%20365%20Defender%20alert%20was%20triggered%2C%20as%20we've%20onboarded%20the%20Exchange%20servers%20to%20Defender%20for%20Endpoint.%20Of%20course%20you%20can%20change%20the%20script%20and%20add%20the%20error%20message%20in%20the%20OS%20language%20if%20you%20want%20it%20to%20display%20the%20correct%20result.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2576429%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2576429%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F462123%22%20target%3D%22_blank%22%3E%40Test-RRR%3C%2FA%3E%26nbsp%3BAre%20you%20sure%20that%20you%20are%20in%20ProgramData%20not%20Program%20Files%3F%20I%20have%20checked%20all%20my%20labs%20and%20all%20of%20them%20have%20the%20Platform%20folder.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2579234%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2579234%22%20slang%3D%22en-US%22%3E%3CP%3EGreat%20Info%2C%20thanks.%3C%2FP%3E%3CP%3ENow%20its%20not%20a%20complete%20black%20box%20anymore.%3C%2FP%3E%3CP%3EI%20will%20extend%20our%20monitoring%20to%20include%20those%20logs!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20sccm%20and%20using%20endpoint%20protection%20on%20your%20exchange%20servers%20gives%20great%20visibility%20into%20amsi.%3C%2FP%3E%3CP%3EVery%20nice!%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22justsomeadmin_0-1627046753459.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F298011i0A9EE794CFF07D81%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22justsomeadmin_0-1627046753459.png%22%20alt%3D%22justsomeadmin_0-1627046753459.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2572371%22%20slang%3D%22en-US%22%3EMore%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2572371%22%20slang%3D%22en-US%22%3E%3CP%3EThe%20Windows%20Antimalware%20Scan%20Interface%26nbsp%3B(AMSI)%20is%20a%20versatile%20standard%20that%20allows%20applications%20and%20services%20to%20integrate%20with%20any%20antimalware%20product%20present%20on%20a%20machine.%26nbsp%3BAMSI%20is%20vendor%20agnostic%20and%20designed%20to%20allow%20for%20the%20most%20common%20malware%20scanning%20and%20protection%20techniques%20provided%20by%20today's%20products%20to%20be%20integrated%20into%20applications.%3C%2FP%3E%0A%3CP%3ESeeing%20that%20Exchange%20administrators%20might%20not%20be%20familiar%20with%20AMSI%2C%20we%20wanted%20to%20provide%20an%20overview%20of%20various%20components%20that%20make%20this%20work%2C%20because%E2%80%A6%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--407918769%22%20id%3D%22toc-hId--407828494%22%20id%3D%22toc-hId--407828494%22%20id%3D%22toc-hId--407828494%22%20id%3D%22toc-hId--407828494%22%3EExchange%20Server%20integration%20arrives%3C%2FH2%3E%0A%3CP%3EAs%20of%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexchange-team-blog%2Freleased-june-2021-quarterly-exchange-updates%2Fba-p%2F2459826%22%20target%3D%22_blank%22%3EJune%202021%20quarterly%20updates%3C%2FA%3E%2C%20Exchange%20Server%20supports%20integration%20with%20AMSI.%20This%20provides%20the%20ability%20for%20an%20AMSI-capable%20antivirus%2Fantimalware%20solution%20to%20scan%20content%20in%20HTTP%20requests%20sent%20to%20the%20Exchange%20Server%20and%20block%20a%20malicious%20request%20before%20it%20is%20handled%20by%20Exchange.%20The%20scan%20is%20performed%20in%20real-time%20as%20the%20server%20begins%20to%20process%20the%20request.%20AMSI%2C%20as%20implemented%20in%20June%202021%20Cumulative%20Updates%20(CUs)%2C%20only%20scans%20the%20HTTP%20protocol%2C%20and%20is%20not%20meant%20to%20be%20a%20replacement%20to%20existing%20server-level%20or%20message%20hygiene%20protections.%3C%2FP%3E%0A%3CP%3EThere%20is%20no%20observed%20performance%20impact%20from%20AMSI%20scanning%20when%20tested%20with%20Microsoft%20Defender%20and%20no%20changes%20to%20be%20made%20to%20the%20existing%20documented%20Exchange%20Sever%20antivirus%20exclusions.%20Each%20antivirus%20provider%20develops%20their%20own%20definitions%20that%20utilize%20AMSI%20technology%2C%20therefore%20your%20level%20of%20protection%20remains%20dependent%20on%20how%20quickly%20your%20specific%20solution%20can%20be%20dynamically%20updated%20to%20detect%20the%20latest%20threats.%3C%2FP%3E%0A%3CP%3EThe%20following%20steps%20will%20help%20you%20understand%20a%20bit%20more%20about%20what%20is%20needed%20on%20each%20of%20the%20Exchange%20servers%20to%20ensure%20that%20AMSI%20Integration%20is%20enabled%20and%20working%3A%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-2079594064%22%20id%3D%22toc-hId-2079684339%22%20id%3D%22toc-hId-2079684339%22%20id%3D%22toc-hId-2079684339%22%20id%3D%22toc-hId-2079684339%22%3EAMSI%20integration%20with%20Exchange%20Server%20prerequisites%3C%2FH2%3E%0A%3CP%3ETo%20start%20let%E2%80%99s%20make%20sure%20our%20Exchange%20Server%20can%20even%20support%20AMSI%20integration.%20Check%20the%20following%20prerequisites%20on%20each%20server%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWindows%20Server%202016%2C%20or%20higher%3C%2FLI%3E%0A%3CLI%3EExchange%20Server%202016%20CU21%20%2F%20Exchange%20Server%202019%20CU10%2C%20or%20higher%3C%2FLI%3E%0A%3CLI%3EMicrosoft%20Defender%20with%20AV%20engine%20version%20at%20or%20higher%20than%201.1.18300.4%20(alternatively%2C%20a%20compatible%20AMSI%20capable%20third-party%20AV%20provider%20%E2%80%93%20please%20check%20with%20your%20vendor)%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH2%20id%3D%22toc-hId-272139601%22%20id%3D%22toc-hId-272229876%22%20id%3D%22toc-hId-272229876%22%20id%3D%22toc-hId-272229876%22%20id%3D%22toc-hId-272229876%22%3EHow%20to%20find%20your%20installed%20AMSI%20provider%3C%2FH2%3E%0A%3CP%3ENow%20that%20you%20have%20met%20the%20prerequisites%20let%E2%80%99s%20confirm%20that%20you%20have%20an%20AMSI%20provider%20installed%20on%20the%20server.%20To%20do%20so%20you%20will%20need%20to%20run%20the%20following%20Windows%20PowerShell%20commands%20and%20review%20the%20output%3A%3C%2FP%3E%0A%3CP%20class%3D%22code%22%3EGet-ChildItem%26nbsp%3B'HKLM%3A%5CSOFTWARE%5CMicrosoft%5CAMSI%5CProviders'%20-recurse%3CBR%20%2F%3EGet-ChildItem%26nbsp%3B'HKLM%3A%5CSOFTWARE%5CClasses%5CCLSID%5C%7B%3CEM%3EGUID%20obtained%20from%20previous%20command%3C%2FEM%3E%7D'%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20you%20can%20set%20a%20variable%20and%20then%20search%20for%20the%20RegEx%20Results%20of%20all%20AMSI%20Providers%20installed%20by%20running%3A%3C%2FP%3E%0A%3CP%20class%3D%22code%22%3E%24AMSI%20%3D%20Get-ChildItem%20'HKLM%3A%5CSOFTWARE%5CMicrosoft%5CAMSI%5CProviders'%20-Recurse%3CBR%20%2F%3E%24AMSI%20-match%20'%5B0-9A-Fa-f%5C-%5D%7B36%7D'%3CBR%20%2F%3E%24Matches.Values%20%7C%20ForEach-Object%20%7BGet-ChildItem%20%22HKLM%3A%5CSOFTWARE%5CClasses%5CCLSID%5C%7B%24_%7D%22%20%7C%20Format-Table%20-AutoSize%7D%3C%2FP%3E%0A%3CP%3EFor%20example%3A%3C%2FP%3E%0A%3CP%20class%3D%22code%22%3EWindows%20PowerShell%3CBR%20%2F%3ECopyright%20(C)%20Microsoft%20Corporation.%20All%20rights%20reserved.%3CBR%20%2F%3EC%3A%5CPowerShell%26gt%3B%20%24AMSI%20%3D%20Get-ChildItem%20'HKLM%3A%5CSOFTWARE%5CMicrosoft%5CAMSI%5CProviders'%20-Recurse%3CBR%20%2F%3EC%3A%5CPowerShell%26gt%3B%20%24AMSI%20-match%20'%5B0-9A-Fa-f%5C-%5D%7B36%7D'%3CBR%20%2F%3EC%3A%5CPowerShell%26gt%3B%20%24Matches.Values%20%7C%20ForEach-Object%20%7BGet-ChildItem%20%22HKLM%3A%5CSOFTWARE%5CClasses%5CCLSID%5C%7B%24_%7D%22%20%7C%20Format-Table%20-AutoSize%7D%20%3CBR%20%2F%3E%3CBR%20%2F%3EHive%3A%20HKEY_LOCAL_MACHINE%5CSOFTWARE%5CClasses%5CCLSID%5C%7B2781761E-28E0-4109-99FE-B9D127C57AFE%7D%3CBR%20%2F%3E%3CBR%20%2F%3EName%20Property%3CBR%20%2F%3E----%20--------%3CBR%20%2F%3EHosts%20(default)%20%3A%20Scanned%20Hosting%20Applications%3CBR%20%2F%3EImplemented%20Categories%3CBR%20%2F%3EInprocServer32%20(default)%20%3A%20%22C%3A%5CProgramData%5CMicrosoft%5CWindows%20Defender%5CPlatform%5C4.18.2106.6-0%5CMpOav.dll%22%3CBR%20%2F%3EThreadingModel%20%3A%20Both%3C%2FP%3E%0A%3CP%3EThe%20results%20show%20us%20that%20the%20only%20provider%20we%20have%20installed%20is%20in%20C%3A%5CProgramData%5CMicrosoft%5CWindows%20Defender%5CPlatform%5C4.18.2106.6-0%5CMpOav.dll%20which%20is%20Microsoft%20Windows%20Defender.%20So%20now%20we%20know%20that%20the%20Windows%202016%20operating%20system%20or%20higher%20sees%20our%20AMSI%20Provider%20installation.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1535314862%22%20id%3D%22toc-hId--1535224587%22%20id%3D%22toc-hId--1535224587%22%20id%3D%22toc-hId--1535224587%22%20id%3D%22toc-hId--1535224587%22%3EWeb.config%20files%3C%2FH2%3E%0A%3CP%3ENext%20for%20AMSI%20Integration%20to%20work%20correctly%20we%20need%20to%20make%20sure%20that%20the%20HttpRequestFilteringModule%20line%20below%20is%20present%20in%20the%20%3CEM%3E%3CMODULES%3E%20%3C%2FMODULES%3E%3C%2FEM%3Esection%20of%20the%20FrontEnd%20and%20ClientAccess%20web.config%20files%3A%3C%2FP%3E%0A%3CP%20class%3D%22code%22%3E%3CADD%20name%3D%22%26quot%3BHttpRequestFilteringModule%26quot%3B%22%20type%3D%22%26quot%3BMicrosoft.Exchange.HttpRequestFiltering.HttpRequestFilteringModule%2C%22%20microsoft.exchange.httprequestfiltering%3D%22%22%3E%3C%2FADD%3E%3C%2FP%3E%0A%3CP%3EIf%20you%20make%20a%20habit%20of%20replacing%20web.config%20files%2C%20you%20need%20to%20make%20sure%20that%20you%20have%20this%20line%20or%20AMSI%20will%20not%20work%20properly.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-952197971%22%20id%3D%22toc-hId-952288246%22%20id%3D%22toc-hId-952288246%22%20id%3D%22toc-hId-952288246%22%20id%3D%22toc-hId-952288246%22%3EConfirm%20your%20Windows%20Defender%20version%20via%20the%20command%20line%3C%2FH2%3E%0A%3CP%3EIf%20you%20are%20using%20Microsoft%20Windows%20Defender%20jump%20into%20the%20command%20line%20and%20make%20sure%20you%20have%20updated%20the%20signatures%20to%20the%20latest%20version.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ELaunch%20Command%20Prompt%20as%20an%20administrator%3C%2FLI%3E%0A%3CLI%3ENavigate%20to%20C%3A%5CProgramData%5CMicrosoft%5CWindows%20Defender%5CPlatform%5C%3CANTIMALWARE%20platform%3D%22%22%20version%3D%22%22%3E%3C%2FANTIMALWARE%3E%3C%2FLI%3E%0A%3CLI%3ERun%20mpcmdrun.exe%20-SignatureUpdate.%20This%20will%20check%20for%20the%20latest%20definitions%20and%20report%20your%20current%20engine%20version.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%20class%3D%22code%22%3EMicrosoft%20Windows%20Command%20Prompt%3CBR%20%2F%3ECopyright%20(C)%20Microsoft%20Corporation.%20All%20rights%20reserved.%3CBR%20%2F%3EC%3A%5CProgramData%5CMicrosoft%5CWindows%20Defender%5CPlatform%5C4.18.2105.5-0%26gt%3BMpCmdRun.exe%20-SignatureUpdate%3CBR%20%2F%3ESignature%20update%20started%20.%20.%20.%3CBR%20%2F%3EService%20Version%3A%204.18.2106.6%3CBR%20%2F%3EEngine%20Version%3A%201.1.18300.4%3CBR%20%2F%3EAntiSpyware%20Signature%20Version%3A%201.343.1364.0%3CBR%20%2F%3EAntiVirus%20Signature%20Version%3A%201.343.1364.0%3CBR%20%2F%3ESignature%20update%20finished.%20No%20updates%20needed%3CBR%20%2F%3EC%3A%5CProgramData%5CMicrosoft%5CWindows%20Defender%5CPlatform%5C4.18.2105.5-0%26gt%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--855256492%22%20id%3D%22toc-hId--855166217%22%20id%3D%22toc-hId--855166217%22%20id%3D%22toc-hId--855166217%22%20id%3D%22toc-hId--855166217%22%3EConfirm%20that%20AMSI%20integration%20is%20working%3C%2FH2%3E%0A%3CP%3EIf%20any%20request%20is%20detected%20to%20be%20malicious%20by%20the%20AMSI%20module%20it%20is%20logged%20in%20the%20%25ExchangeInstallPath%25%5CLogging%5CHttpRequestFiltering%20folder%20and%20the%20value%20for%20ScanResult%20is%20%E2%80%9CDetected%E2%80%9D.%20This%20module%20does%20not%20create%20logs%20for%20safe%20calls%20so%2C%20if%20a%20log%20is%20present%20then%20a%20malicious%20call%20was%20seen%20at%20some%20point.%20When%20a%20request%20get%20blocked%20IIS%20will%20issues%20return%20code%20400%20%2F%20Bad%20Request%20back%20to%20the%20requestor.%3C%2FP%3E%0A%3CP%3EOnce%20a%20malicious%20connection%20is%20detected%20the%20log%20will%20look%20something%20like%20this%3A%3C%2FP%3E%0A%3CP%20class%3D%22code%22%3EDateTime%2CMajorVersion%2CMinorVersion%2CBuildVersion%2CRevisionVersion%2CServerHostName%2CSharedCacheLatency%2CTotalLatency%2CHttpMethod%2CUrlHost%2CUrlStem%2CUrlQuery%2CServerIP%2CProtocol%2CHeaderNames%2CCookieNames%2CScanResult%2CGenericInfo%2CGenericErrors%3CBR%20%2F%3E%23Software%3A%20Microsoft%20Exchange%20Server%3CBR%20%2F%3E%23Version%3A%2015.01.build%3CBR%20%2F%3E%23Log-type%3A%20Http%20Request%20Filtering%20Logs%3CBR%20%2F%3E%23Date%3A%202021-06-30T10%3A03%3A57.573Z%3CBR%20%2F%3E%23Fields%3A%3CBR%20%2F%3EDateTime%2CMajorVersion%2CMinorVersion%2CBuildVersion%2CRevisionVersion%2CServerHostName%2CSharedCacheLatency%2CTotalLatency%2CHttpMethod%2CUrlHost%2CUrlStem%2CUrlQuery%2CServerIP%2CProtocol%2CHeaderNames%2CCookieNames%2CScanResult%2CGenericInfo%2CGenericErrors%3CBR%20%2F%3E6%2F30%2F2021%2010%3A03%3A57%20AM%2C15%2C1%2C2334%2C0%2CSERVER01%2C%2C%2CPOST%2Clocalhost%2C%2Fecp%2Fx.js%2C%2C%3A%3A1%2CFrontEnd.Ecp%2CContent-Length%3BCookie%3BHost%2CX-BEResource%2CDetected%2C%2C%3CBR%20%2F%3E6%2F30%2F2021%2010%3A09%3A41%20AM%2C15%2C1%2C2334%2C0%2CSERVER01%2C%2C%2CPOST%2CSERVER01.contoso.com%2C%2Fecp%2Fx.js%2C%2C192.168.10.52%2CFrontEnd.Ecp%2CContent-Length%3BCookie%3BHost%2CX-BEResource%2CDetected%2C%2C%3CBR%20%2F%3E6%2F30%2F2021%2010%3A09%3A43%20AM%2C15%2C1%2C2334%2C0%2CSERVER01%2C%2C%2CPOST%2CSERVER01.contoso.com%2C%2Fecp%2Fx.js%2C%2C192.168.10.52%2CFrontEnd.Ecp%2CContent-Length%3BCookie%3BHost%2CX-BEResource%2CDetected%2C%2C%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1632256341%22%20id%3D%22toc-hId-1632346616%22%20id%3D%22toc-hId-1632346616%22%20id%3D%22toc-hId-1632346616%22%20id%3D%22toc-hId-1632346616%22%3EHow%20to%20disable%20AMSI%20integration%20with%20Exchange%20Server%3C%2FH2%3E%0A%3CP%3EIf%20for%20some%20reason%20you%20need%20to%20temporarily%20disable%20the%20AMSI%20integration%20for%20testing%20or%20troubleshooting%20purposes.%20You%20can%20do%20so%20by%20opening%20Exchange%20Management%20Shell%20and%20create%20a%20new%20server%20override%3A%3C%2FP%3E%0A%3CP%20class%3D%22code%22%3EWelcome%20to%20the%20Exchange%20Management%20Shell!%3CBR%20%2F%3E%5BPS%5D%20C%3A%5CPowerShell%26gt%3B%20New-SettingOverride%20-Name%20%22DisablingAMSIScan%22%20-Server%20ServerName%20-Component%20Cafe%20-Section%20HttpRequestFiltering%20-Parameters%20(%22Enabled%3DFalse%22)%20-Reason%20%22Testing%22%3CBR%20%2F%3E%5BPS%5D%20C%3A%5CPowerShell%26gt%3B%20Get-ExchangeDiagnosticInfo%20-Process%20Microsoft.Exchange.Directory.TopologyService%20-Component%20VariantConfiguration%20-Argument%20Refresh%3CBR%20%2F%3E%5BPS%5D%20C%3A%5CPowerShell%26gt%3B%20Restart-Service%20-Name%20W3SVC%2C%20WAS%20-Force%3C%2FP%3E%0A%3CP%20style%3D%22background%3A%20%23F0F0F0%3B%20padding%3A%20.5em%3B%20margin%3A%201em%200%201em%200%3B%22%3ENote%3A%26nbsp%3BIf%20you%20set%20the%20override%20without%20using%20the%20-Server%20parameter%2C%20the%20override%20applies%20to%20all%20Exchange%202016%2F2019%20servers%20in%20the%20forest.%3C%2FP%3E%0A%3CP%3EOnce%20your%20testing%20is%20complete%2C%20re-enable%20the%20AMSI%20integration%20by%20removing%20the%20setting%20override%3A%3C%2FP%3E%0A%3CP%20class%3D%22code%22%3EWelcome%20to%20the%20Exchange%20Management%20Shell!%3CBR%20%2F%3E%5BPS%5D%20C%3A%5CPowerShell%26gt%3B%20Remove-SettingOverride%20-Name%20%22DisablingAMSIScan%22%20-Component%20Cafe%20-Section%20HttpRequestFiltering%20-Parameters%20(%22Enabled%3DFalse%22)%20-Reason%20%22Testing%22%3CBR%20%2F%3E%5BPS%5D%20C%3A%5CPowerShell%26gt%3B%20Get-ExchangeDiagnosticInfo%20-Process%20Microsoft.Exchange.Directory.TopologyService%20-Component%20VariantConfiguration%20-Argument%20Refresh%3CBR%20%2F%3E%5BPS%5D%20C%3A%5CPowerShell%26gt%3B%20Restart-Service%20-Name%20W3SVC%2C%20WAS%20-Force%3C%2FP%3E%0A%3CP%3EYou%20will%20have%20to%20restart%20the%20Internet%20Information%20Services%20(IIS)%20on%20the%20machine%20which%20will%20disrupt%20connectivity%20so%20make%20sure%20to%20do%20this%20when%20there%20will%20be%20no%20impact%20to%20the%20server%20or%20under%20a%20maintenance%20period.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--175198122%22%20id%3D%22toc-hId--175107847%22%20id%3D%22toc-hId--175107847%22%20id%3D%22toc-hId--175107847%22%20id%3D%22toc-hId--175107847%22%3ESelf-service%20test%20script%3C%2FH2%3E%0A%3CP%3EThe%20new%20script%20we%20have%20created%20will%20let%20you%20test%20your%20Exchange%20Server%20AMSI%20integration%20with%20Microsoft%20Defender.%20The%20script%20can%20send%20a%20crafted%20HTTP%20request%20that%20will%20trigger%20the%20anti-malware%20scanner%20and%20once%20run%20you%20can%20check%20the%20%5CHttpRequestFiltering%20folder%20for%20a%20log.%20The%20script%20can%20also%20check%20your%20AMSI%20Providers%20on%20the%20system%20and%20even%20enable%20and%20disable%20AMSI%20integration.%20The%20script%20is%20available%20at%20the%20CSS-Exchange%20Repo%20on%20GitHub%20%5B%3CA%20href%3D%22https%3A%2F%2Faka.ms%2FTest-AMSI%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3ETest-AMSI%3C%2FA%3E%5D.%20Please%20see%20GitHub%20for%20script%20usage%20tips%20%2F%20documentation!%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22author%22%3EAng%C3%A9lique%20Conde%2C%20Rob%20Whaley%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2572371%22%20slang%3D%22en-US%22%3E%3CP%3EAs%20of%20the%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fexchange-team-blog%2Freleased-june-2021-quarterly-exchange-updates%2Fba-p%2F2459826%22%20target%3D%22_blank%22%3EJune%202021%20quarterly%20updates%3C%2FA%3E%2C%20Exchange%20Server%20supports%20integration%20with%20AMSI...%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2572371%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExchange%202016%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EExchange%202019%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESecurity%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ETips%20'n%20Tricks%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2739594%22%20slang%3D%22en-US%22%3ERe%3A%20More%20about%20AMSI%20integration%20with%20Exchange%20Server%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2739594%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20cmd%20(%3CEM%3E%3CSTRONG%3EGet-ChildItem%3C%2FSTRONG%3E%3CSTRONG%3E%20'HKLM%3A%5CSOFTWARE%5CMicrosoft%5CAMSI%5CProviders'%20-recurse%3C%2FSTRONG%3E)%26nbsp%3Bdoes%20not%20return%20anything%20on%20a%26nbsp%3B%202k19%20server%20with%20exchange%202k19.%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Sep 01 2021 09:18 AM
Updated by:
www.000webhost.com