Iis 7.0, reordering a module

"records cannot be reordered because one or more of them were locked in the parent file

in iis manager 7.0, when I try to change the order of modules in my application, it gives this message.

How can I change the order of modules? Is it possible?

+6
iis-7
source share
2 answers

Can you do this at the server level instead of the site level?

+3
source share

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.

+2
source share

All Articles