Internal Server Error on SharePoint Server 2019 O-Premises after Update – Missing IIS Module “SPRequestFilterModule”.

Currently I investigate a problem. A SharePoint Server 2019 page showed me an Internal Server Error 500.

SharePoint Server 2019 is installed on Windows Server 2022. The August 2023 CU is applied.

After enabling “Failed Request Tracing” I saw this log message in “Failed Request Logs” on disk (C:\inetpub\logs\FailedReqLogFiles\W3SVCxxxxxxxx)

To enable “Failed Request Tracking”…

After I configured the “Failed Request Logging” I found a XML file on disk that is rendered as follows in the browser…

Now looking at the “Modules” config of the SharePoint web site in IIS I saw:

The module is missing…

I registered it by selecting the server level in the tree

Then… Open “Modules”

In the list the “SPRequestFilterModule” is missing:

On the right pane select “Configure Native Modules”:

Here the module is also missing

Now click “Register…”.

Add the module with name

SPRequestFilterModule

and Path

C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\isapi\sprequestfilteringmodule.dll

Click on.

Try reloading the SharePoint page in browser. That’s it 🙂

I created this script to fix the issue:

$fn = "$([environment]::GetEnvironmentVariable("SystemRoot"))\system32\inetsrv\config\applicationhost.config"
$l = [System.Collections.Generic.List[string]]::new( ([system.io.file]::ReadAllLines($fn)) )

if( $null -eq ($l | ? { $_ -like "*SPRequestFilterModule*"} ) ) {
    Write-Host "SPRequestFilterModule not found..."

    if( (Test-Path "C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\isapi\sprequestfilteringmodule.dll") ) {
        write-host "missing module found on disk!"

        . iisreset /stop

        $m = @()
        for( $i = 0; $i -lt $l.Count; $i++ ) {
            if( $l[$i].IndexOf("</globalModules>", [StringComparison]::OrdinalIgnoreCase) -ge 0) {
                $l.Insert($i, '            <add name="SPRequestFilterModule" image="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\16\isapi\sprequestfilteringmodule.dll" preCondition="bitness64" />')
                break
            }
        }

        [system.io.file]::WriteAllLines($fn, $l.ToArray())

        . iisreset /start
    } else {
        Write-Error "Missing module DLL not found on disk!"
    }
} else {
    Write-Host "SPRequestFilterModule is already registered in IIS!"
}

PS: I found an article on Microsoft Learning. There I will leave a comment on that topic.

https://learn.microsoft.com/en-us/answers/questions/1228993/recent-sp-security-update-causes-iis-to-throw-a-50