Home > OS >  IIS How To Check If Parent Path Option Is Enabled/Disabled Via Command Line?
IIS How To Check If Parent Path Option Is Enabled/Disabled Via Command Line?

Time:04-23

On IIS, following the steps below allows disabling/enabling the parent path option:

Log into the IIS Administration Console.
Open the Directory Browsing section.
Select On or Off to enable or disable the Parent Paths option.
Click Set Parent Paths to save your setting.

I am trying to get the status of this setting to see if it is enabled or disabled via cmd/PowerShell, however, it seems there is not much info on this online, is this possible via commandline?

CodePudding user response:

You can use this powershell command to enable or disable parent path. Just change the value to true or false.

Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter "system.webServer/asp" -name "enableParentPaths" -value "False"

Yes. If you want to get the configured value of it, you can use this one.

Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' -location 'Default Web Site' -filter "system.webServer/asp" -name "enableParentPaths" | select value

enter image description here

  • Related