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

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.

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.”

I was afraid that would be the response. :frowning:

Thanks, Don.

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 "*"