SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to be able to modify, via C# in a SharePoint solution, the STS web.config across multiple servers. What is the proper way to do this since the WebConfigModificationn class doesn't take this web.config into account?

share|improve this question
up vote 0 down vote accepted

Timer job that is run once on feature activation. Chris Keyser has a post about updating settings on each server in a farm, and you can use that as a base for your code.

share|improve this answer
I've been thinking over this one, and I'm wondering if it wouldn't be a good idea to create a "STS sync"-type Timer Job. All changes made by the administrator would be stored in a config file that the STS sync would then execute and update the STS web.config for each server in the farm. It would periodically run to validate that the STS config was consistent. Only issue I'm having is how to properly identify the path to the STS web.config. I can hard code it, but that wouldn't be a good idea. – Trevor Seward Dec 10 '12 at 1:33

Your Answer


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.