Using Powershell how to Revert-to-Parent in handler mappings for an application

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 1 year, 10 months ago.

  • Author
  • #48566


    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 1 year, 10 months ago by  Kavya.
  • #49640

    Don Jones

    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?

You must be logged in to reply to this topic.