Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to run a command to set up anonymous authentication on a folder under a Web Application on IIS. I would like the particular folder to be the only thing affected. I don't want to change the anonymous authentication for the entire Web Application.

Edit 29. July 2013:
Still not having adequate answer :( Adding some key facts:
- I need this in a script as part of installation process.
- I don't want to rely on IIS powershell snap-in.
- I know about possibility of setting this up via web config and I don't have a problem with that but I can't alter any config outside of my Web Application. I can't alter C:\Windows\System32\inetsrv\config\applicationHost.config, so, this option is out.

This can very easily be done via IIS Manager (GUI).

share|improve this question

migrated from stackoverflow.com Aug 1 '13 at 20:30

This question came from our site for professional and enthusiast programmers.

    
I am sorry that I can not give you any advice, but I am really interested in the question and I am curious to see the answer here. Let's be patient, hopefully someone will know.. anyway, happy name's day, for its st.Anne today :-) –  Marzena Jul 26 '13 at 13:17
    
@Marzena well, you are seriously hitting on me –  Lorem Ipsum Jul 26 '13 at 13:18
    
possible duplicate: stackoverflow.com/questions/10351075/… –  ton.yeung Jul 26 '13 at 21:17
    
@ton.yeung will have to try on monday at work to let you know if that is what I am looking for ;) –  Lorem Ipsum Jul 26 '13 at 21:36
    
@ton.yeung so I tried it, unfortunately it is not a solution. In order to make that work I have to change something in C:\Windows\System32\inetsrv\config\applicationHost.config. This is NOT what I can actually do on our production servers. Our operations do not allow me to do so because this might affect other applications running on that production server. –  Lorem Ipsum Jul 29 '13 at 8:16

2 Answers 2

up vote 2 down vote accepted

Use AppCmd to allow overriding section configuration in application Web.config:

%systemroot%\system32\inetsrv\APPCMD unlock config  /section:security/authentication/anonymousAuthentication

Unlocking a particular section will allow child Web.config in a particular directory to apply. Just keep in mind that unlocking the section is applied globally.

share|improve this answer
1  
I think it is the best I can get, so, I will have to live with that. –  Lorem Ipsum Jul 30 '13 at 10:59

Pasted from http://www.iis.net/configreference/system.webserver/security/authentication/anonymousauthentication ... This should give you an idea ...

appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /enabled:"True" /commit:apphost appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /userName:"IUSR" /commit:apphost appcmd.exe set config "Contoso" -section:system.webServer/security/authentication/anonymousAuthentication /password:"P@ssw0rd" /commit:apphost

share|improve this answer
    
I found that web page too... then I spent like 1h trying some commands with no success. This is not what I am looking for but thanks for a try. –  Lorem Ipsum Jul 26 '13 at 20:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.