views:

32

answers:

1

I have an IIS 7 machine with multiple apps/vdirs on the single default web site. I would like to set two of them with this authentication: anonymous - off impersonation - on forms auth - off windows auth - on

I would like to do this with appcmd.exe but cannot seem to get the syntax down right. Has anyone had luck with this?

Thanks.

+1  A: 

You should try Configuration Editor (included in IIS 7.5 and available for download for IIS 7.0 at http://www.iis.net/download/AdministrationPack), it can generate the AppCmd.exe commands automatically as well as javascript and managed code. Using it I generated the following (for default web site):

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"False"  

appcmd.exe set config "Default Web Site" -section:system.web/identity /impersonate:"True"  

appcmd.exe set config "Default Web Site" -section:system.webServer/security/authentication/windowsAuthentication /enabled:"True"  /commit:apphost

Note that the ones with commit:apphost are because the sections are locked by default which means they need to be set inside ApplicationHost.config using location paths.

CarlosAg
Perfect answer. Thanks! I had no idea that was in the administration pack.
ScSub