Get-WebConfiguration: Commit Path contains one or more invalid characters

This topic contains 3 replies, has 2 voices, and was last updated by  Ed Redmond 1 year ago.

  • Author
  • #69004

    Ed Redmond

    I am trying to enumerate through a number of web sites defined on an IIS server and get some configuration information on that site. However whenever it encounters a website with a parenthesis it gives the following error.

    Get-WebConfiguration : Commit path contains one or more invalid characters.

    My Google-fu is failing me.

    Any thoughts as to why this might be. I have tried encoding the parenthesis but to no avail.

  • #69385

    Don Jones

    Yeah, that's kind of a thing with IIS and is basically a bug in the module. The answer is, "don't use parentheses in site names."

  • #69451

    Ed Redmond

    I was afraid that would be the response. 🙁

    Thanks, Don.

  • #70017

    Ed Redmond

    I found a workaround for this issue. Instead of using the Get-WebConfiguration cmdlet, you need to use the Get-WebConfigurationProperty cmdlet.

    So instead of using

    Get-WebConfiguration "/system.webServer/security/dynamicIpSecurity/denyByConcurrentRequests" -PSPath "IIS:\Sites\somesitename"

    You can use

    Get-WebConfigurationProperty -filter "/system.webServer/security/dynamicIpSecurity/denyByConcurrentRequests" -PSPath "IIS:\Sites\somesitename" -name "*"

You must be logged in to reply to this topic.