To change the order of modules for a site, you first need to unlock the affected modules at the server level. Since you really don't know which modules are affected, I usually unlock them all. The easiest way to do this is with the PowerShell script (if you are still on IIS7, you need to download the PowerShell IIS snapin ).
Save the following in a text file: unlock-modules.ps1
Import-Module WebAdministration Get-WebConfiguration ` -pspath 'MACHINE/WEBROOT/APPHOST' ` -filter "system.webServer/modules/add" -recurse | ` where {$_.PSPath -eq 'MACHINE/WEBROOT/APPHOST' -and $_.Type -eq ''} ` | foreach { $filter = "system.webServer/modules/add[@name='" + $_.Name + "']" Remove-WebConfigurationLock -pspath 'MACHINE/WEBROOT/APPHOST' -filter $filter -verbose }
Open the PowerShell prompt as an elevated administrator and run the script.
The script is executed through all modules at the server level. Usually only native modules are blocked (with and with the empty type property). Unlock them all.
Now you can make changes to the order of the module at the site level.
Be careful when re-ordering, if you reorder some system modules, IIS may stop working as expected.
Also remember that if you make changes to the modules at the server level, the site no longer inherits them, and you must also apply them at the site level.
Peter Hahndorf
source share