Last active
June 25, 2020 16:11
-
-
Save dazinator/46ddf29f406bf66bc2b0 to your computer and use it in GitHub Desktop.
Powershell to unlock IIS config section system.webServer/handlers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$assembly = [System.Reflection.Assembly]::LoadFrom("$env:systemroot\system32\inetsrv\Microsoft.Web.Administration.dll") | |
$manager = new-object Microsoft.Web.Administration.ServerManager | |
# load appHost config | |
$config = $manager.GetApplicationHostConfiguration() | |
Write-Host "Unlocking system.webServer/handlers" | |
$section = $config.GetSection('system.webServer/handlers') | |
$section.OverrideMode = 'Allow' | |
$manager.CommitChanges() | |
Write-Host "Unlocked system.webServer/handlers" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This didn't work for me, I am trying to unlock section for an application created under a default web site.
The manual steps are as below
I dont get any error after the above powershell is executed but system.webServer/Handlers still shows locked for that particular application available under default web site.
Any help?