removing isapifilter problems RRS feed

  • Question

  • User1831766732 posted

    I am trying to remove a no longer used isapifilter with powershell.

    Here is what I am doing,  this removes it from the server level but does not remove the one loaded at the web site level. 

    Thank You anyone that can guide me.


    Import-Module WebAdministration

    # remove millsecure if it is loaded

    $isapiFilterName = 'millsecure'

    $iispathFilter = 'iis:\'

    cd iis:\

    iisreset /stop

    if (Get-WebConfigurationProperty -filter //isapifilters -pspath $iispathFilter -name Collection[name="$isapiFilterName"]) {

         Remove-WebConfigurationProperty -filter //isapifilters -pspath $iispathFilter -name Collection[name="$isapiFilterName"] }


    Wednesday, August 28, 2013 3:52 PM

All replies

  • User-341820244 posted

    Try this:

    Remove-WebConfigurationProperty -Filter system.webServer/isapiFilters -PSPath MACHINE/WEBROOT/APPHOST -Name . -AtElement @{name=$isapiFilterName} 

    Thursday, August 29, 2013 3:00 AM
  • User1831766732 posted

    Thank You for responding.

    No that did not work, and it actually gave me a Yellow warning.

    WARNING: Property . is not found on /system.webserver/isapiFilters at index @{name="millsecure"}

    ----additional information:

    If I use $iispathFilter = 'IIS\Sites\mill2013'   then it finds the filter with Get-WebConfigurationProperty -filter //isapifilters -pspath $iispathFilter -name Collection[name="$isapiFilterName"]

    but I get an error with :Remove-WebConfigurationProperty -filter //isapifilters -pspath $iispathFilter -name Collection[name="$isapiFilterName"]

    The error is :

    Remove-WebConfigurationProperty : Filename: Error: 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". At line:1 char:32 + Remove-WebConfigurationProperty <<<<  -filter //isapifilters -pspath $iispath Filter -name Collection[name="$isapiFilterName"]     + CategoryInfo          : NotSpecified: (:) [Remove-WebConfigurationProper    ty], FileLoadException     + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.IIs.PowerS    hell.Provider.RemoveConfigurationPropertyCommand




    Thursday, August 29, 2013 11:35 AM
  • User-341820244 posted

    Are you sure that the 'millsecure' filter exists on the server level?

    Thursday, August 29, 2013 1:14 PM
  • User-823319154 posted

    Hi michaele

    Remove an ISAPI filter when you no longer need the functionality that the filter provides,

    To remove an ISAPI filter, use the following syntax:

    appcmd set config /section:isapiFilters /-[name=' string ']

    The variable namestring is the name of the ISAPI filter that you want to remove. For example, to remove an ISAPI filter named ResponseFilter, type the following at the command prompt, and then press ENTER:

    appcmd set config /section:isapiFilters /-[name=' ResponseFilter ']

    Remove an ISAPI Filter (IIS 7) - http://technet.microsoft.com/en-us/library/cc771535(v=ws.10).aspx

    I think it will be good start to remove an ISAPI filter,


    Wednesday, September 4, 2013 2:38 AM
  • User1831766732 posted

    I can successfully remove it at the server level.  What I am finding is that many of our clients also have it loaded at the WebSite level.  It is at that level that I am receiving an error trying to remove it.

    Wednesday, September 4, 2013 3:10 PM
  • User797956788 posted

    The following worked for me for removing an ISAPI filter from the default web site:

    Clear-WebConfiguration -PSPath MACHINE/WEBROOT/APPHOST -Filter "/system.webServer/isapiFilters/filter[@name='jakarta']" -Location "Default Web Site"

    Thursday, February 4, 2016 8:45 AM