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…
Here is the code that worked for me..
To Enable Forms Authentication:
To Disable Forms Authentication:
Just removed
/commit:WEBROOTto get it work.If I am Adding
/commit:WEBROOTthe above code will work only for “Default Web Site” and not for “Default Web Site/Test”