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

Welcome Forums General PowerShell Q&A 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

 
Keymaster
2 years, 5 months ago.

  • Author
    Posts
  • #48566

    Participant
    Points: 0
    Rank: Member

    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"

  • #49640

    Keymaster
    Points: 1,785
    Helping HandTeam Member
    Rank: Community Hero

    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?

The topic ‘Using Powershell how to Revert-to-Parent in handler mappings for an application’ is closed to new replies.