简体   繁体   中英

Appcmd.exe isapiCgiRestriction Error Cannot find requested collection element

I am trying to do an IIs config on a windows 2012 server using the appcmd.exe and trying to run :

C:\\Windows\\System32\\inetsrv\\appcmd.exe set config /section:isapiCgiRestriction /[path='^%windir^%\\Microsoft.NET\\Framework\\v4.0.30319\\aspnet_isapi.dll'].allowed:true

But it gives me an error :

ERROR ( message:Cannot find requested collection element. )

I have tried http://forums.iis.net/t/1181607.aspx where the user suggests placing '^' also c:\\windows\\system32\\inetsrv\\appcmd set config -section:isapiCgiRestriction “/[path='C:\\Windows\\Microsoft.NET\\Framework64\\v4.0.30319\\aspnet_isapi.dll'].allowed:True”

but i keep getting the same error. Any suggestions.

可以通过powershell进行配置。

Set-WebConfiguration -pspath 'MACHINE/WEBROOT/APPHOST' -filter system.webServer/security/isapiCgiRestriction -value @{description='ASP.NET v4.0.30319 (64-bit)';path='%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll';allowed='True'}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM