MODULES Could be unlocked at Server Level or at a Site Level. I am interested in unlocking them at Site Level.
Finally found some space to research this at 0130AM after returning back from Customer Engagements.
asp.net - iis 7.0, module order change - Stack Overflow
Because you don't really know which modules are affected, I tried to unlock them all. The easiest way to do this is with a PowerShell script.
Open a PowerShell prompt as elevated administrator and run the script.
The script loops through all the modules at server level. Usually only the native modules (with and empty 'type' property) are locked. Unlock them all.
Now you can make changes to the order of the module at site level.
Be careful when the re-ordering, if you change the order of some of the system modules, IIS may no longer work in the expected way.
#################################################################################################
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
}
#################################################################################################