IIS 7 and Above
Configuration & Scripting
Use Appcmd.exe change ISAPI and CGI Restrictions
Last post Sep 11, 2018 09:10 AM by Merliny
Sep 03, 2018 07:34 AM|Merliny|LINK
I wanna use Appcmd.exe to change ISAPI andCGI Restrictions settings in IIS, to allow ASP.NET v4.0. And now both ASP.NET v4.0 32bit and 64bit are in the Restrictions list with value 'False', I just wanna amend their value from 'False' to 'True'.
But when I used the command 'appcmd set config /section: isapiCgiRestriction /+"[path='%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll',description=' ASP.NET v4.0.30319 ',allowed='True']"' , it said that there was already one
unique key path.
So how should I change the value with Appcmd? Thanks a lot.
Sep 03, 2018 03:21 PM|lextm|LINK
appcmd.exe set config -section:system.webServer/security/isapiCgiRestriction /[path='%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll'].allowed:"True" /commit:apphost
Learn how to use Configuration Editor feature of IIS Manager, and such can be automatically generated for you.
Sep 04, 2018 06:44 AM|Merliny|LINK
Thanks for your reply.
But when I run this, whether with Power Shell nor CMD.exe is successful. It said that the Collection Index format is wrong.
Any idea for this? Thanks.
PS: My IIS version is 10 and OS is Win 10.
Sep 04, 2018 03:23 PM|lextm|LINK
Then use two commands, first to remove the entry and the second to add it again with allowed set to the value you want.
Sep 11, 2018 09:10 AM|Merliny|LINK
Yep, I already did this as you said. Thanks a lot.