Author Posts

April 19, 2017 at 6:40 pm

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.

April 24, 2017 at 1:50 pm

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

April 25, 2017 at 10:15 am

I was afraid that would be the response. 🙁

Thanks, Don.

May 3, 2017 at 1:39 pm

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