Author Posts

July 28, 2016 at 2:32 pm

I want to modify the IIS Web application Handler mappings to Revert to Parent. I did this manually like below.

Open IIS , Site/Web application, Clicked Handler Mappings, in Actions Clicked "Revert to Parent".

I want to automate this using PowerShell. Can someone help?

I have already tried below :-

1) Clear-WebConfiguration -pspath 'IIS:/sites/Default Web Site/MyWebService' -filter 'system.webServer/handlers'

2) Clear-WebConfiguration -Filter /System.WebServer/Handlers -PSPath 'IIS:/sites/Default Web Site/MyWebService' -force

3) Set-WebConfiguration -Filter /System.WebServer/Handlers -Value @{Name='CGI-exe'; EntryType='Inherited'; AccessPolicy="Read, Script"} -PSPath "IIS:/sites/Default Web Site/MyWebService"

4) Set-WebConfiguration "/system.webServer/handlers/@AccessPolicy/add[@name='CGI-exe']" -Value "Read, Script" -PSPath "IIS:/sites/Default Web Site/MyWebService"

Set-WebConfiguration "/system.webServer/handlers/add[@name='CGI-exe']/@requireAccess" -Value "Execute" -PSPath "IIS:/sites/Default Web Site/MyWebService"

But none suffices my need to "Revert to Parent"

  • This topic was modified 2 years, 1 month ago by  Kavya.

August 8, 2016 at 8:55 pm

Unfortunately, the WebAdministration module is far from being fully functional. Now, mind you, I'd have thought the -WebConfiguration would do it for you, since you're basically modifying web.config (or whatever .config) directly. Have you verified what the .config file XML looks like after making the change manually, and whether or not your command was making a similar change in the XML?