Powershell command to unlock system.WebServer/handler

I’d like to leverage some command line to unlock a section on an IIS site

This seems like such a small thing. I’ve tried IISAdministration module, WebAdministration module, etc.

Hi Blaked, welcome to the forum! :wave:

What did you try? You should always provide as much detail as possible when requesting assistance. Show the command(s) you’ve tried, what happened/didn’t happen, any errors, etc.

Using this as a reference: PowerShell Snap-in: Changing Simple Settings in Configuration Sections | Microsoft Learn

The latest thing I’ve tried is

Set-WebConfigurationProperty -filter /system.webServer/handlers -name IsLocked -value false -PSPath IIS:\ -location test

I get this message: WARNING: Property IsLocked is not found on /system.webServer/handlers.

After a bit more digging, I’m trying

Set-WebConfigurationProperty -filter /system.webServer/handlers/accesspolicy -name IsLocked -value false -PSPath IIS:\ -location test

But I get a different warning:

WARNING: Target configuration object '/system.webServer/handlers/accesspolicy is not found at path ‘MACHINE/WEBROOT/APPHOST’ location ‘test’.

I’ve also tried using appcmd, such as:

.\appcmd list config “test” /section:system.webServer/handlers

I then get another ‘nope, it’s locked’ message:
Description: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault=“Deny”), or set explicitly by a location tag with overrideMode=“Deny” or the legacy allowOverride=“false”.