0

I am building a setup package using the WIX tool. I have a requirement for enabling/disabling Forms Authentication for a particular virtual directory in IIS based on the user requirement. I have tried appcmd command but could not get it to work:

appcmd set config "Default Web Site/Test" /commit:WEBROOT /section:system.web/authentication /mode:Forms /commit:apphost

Please suggest...

Simon
  • 6,062
  • 13
  • 60
  • 97
Vinay Kumar
  • 33
  • 1
  • 7

1 Answers1

1

Here is the code that worked for me..

To Enable Forms Authentication:

appcmd set config "Default Web Site/Test" /section:system.web/authentication /mode:Forms

To Disable Forms Authentication:

appcmd set config "Default Web Site/Test" /section:system.web/authentication /mode:Windows

Just removed /commit:WEBROOT to get it work.

If I am Adding /commit:WEBROOT the above code will work only for "Default Web Site" and not for "Default Web Site/Test"

Vinay Kumar
  • 33
  • 1
  • 7