I’m configuring IIS on some servers to add deny HTTP Verbs to the Request Filtering section. This was done using the following:
Add-WebConfigurationProperty -PSPath 'MACHINE/WEBROOT/APPHOST' -Filter 'system.webServer/security/requestFiltering' -Value @{VERB="OPTIONS";allowed="False"} -Name Verbs -AtIndex 0
…however, I want to be able to confirm the presence of this after it’s been configured. The following shows some properties but not the actual HTTP Verbs list:
Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -filter 'system.webServer/security/requestFiltering' -Name Verbs
I've since found the following command which does show a header for "Verbs" but it's empty regardless of "OPTIONS" being present in the IIS admin console:
Get-WebConfiguration system.webServer/security/RequestFiltering/verbs -Recurse | Select-Object Verbs
What do I need to add to list the verbs present?
Try:
using the full Xpath to the XML node.
Sometimes it helps to look at the
applicationhost.config
file to figure out where exactly data is stored. You may use a Diff tool to see the differences after changing something in the UI.To remove a specific verb, use: