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 Profile photo of Don Jones Don Jones 1 month, 2 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #48566
    Profile photo of Kavya
    Kavya
    Participant

    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 "[email protected]/add[@name='CGI-exe']" -Value "Read, Script" -PSPath "IIS:/sites/Default Web Site/MyWebService"

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

    But none suffices my need to "Revert to Parent"

    • This topic was modified 2 months ago by Profile photo of Kavya Kavya.
    #49640
    Profile photo of Don Jones
    Don Jones
    Keymaster

    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?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.