I'm developing a little installer for some SharePoint features that contain some web parts and a custom Web Service that's used to communicate with a 3rd party application that reads information from some electronic components.
Everything is working fine, but to make it work, i had to enable Anonymous Authentication on my SharePoint's server IIS. I can easily programmatically achieve this on my windows forms installer using the code below:
using (ServerManager serverManager = new ServerManager())
{
Configuration config = serverManager.GetApplicationHostConfiguration();
ConfigurationSection anonymousAuthenticationSection = config.GetSection("system.webServer/security/authentication/anonymousAuthentication", "Sharepoint - 80");
anonymousAuthenticationSection["enabled"] = true;
anonymousAuthenticationSection["userName"] = txtUserName.Text;
anonymousAuthenticationSection["password"] = txtPassword.Text;
serverManager.CommitChanges();
}
But now, i came across something that can be a problem. If i try to use this installer on a Sharepoint Farm, the IIS modification will be applied only on that specific server.
Is there a way to achieve the same result, but applying the modification to all servers on the farm using a Event Receiver on my webpart project?
Thanks a lot.