Script/Tool to modify config files

Hi All

the scenarios is we have 100+ Servers.
I am looking for a script/Tool that would help me in updating config files, like maching.config or web.config or any other config file on the servers.

Example:
At times we need to modify a tag in machine.config. So this tool should ask for Search/Replace kind of thing where I will provide with multiple current tags in machine.config and will also provide new tags that I want to be replaced by the old one.

Also, it should provide with option to add new tag under some parent tag. Ie I will mention that I need to add new tag and then provide the name of parent tag under which I want the new tag to be added.

So, two things as of now

1) Ability to update existing tag
2) Ability to add new tag under some parent tag

Please let me know if you need any further clarification.

Thanks in advance
ghelaniabhishekAsked:
Who is Participating?
 
Steve KnightIT ConsultancyCommented:
Agreed with you here Bill.  Powershell not got enough attention here yet for me either and updating in batch while possible is tricky with all those < > and the like in there.  VBScript easier but feels like pre-inventing the wheel.

Is Powershell an option here, will suggest it gets added as a zone for you.

Meanwhile this sounded like it might be useful though having looked more it is out of date and not suitable:
http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=21714

I haven't tried it yet but JExamXML sounds promising here:
http://www.a7soft.com/download.html

So end of the line for anything I can do easily on this one, will see if Powershell people have a two liner for you!

0
 
Bill PrewCommented:
Are the config files all in the same format?  And can you post a sample of what that format is?

~bp
0
 
ghelaniabhishekAuthor Commented:
lets consider the file to be machine.config
0
Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

 
Steve KnightIT ConsultancyCommented:
Can you supply the informsation that Bill asked for so we can look?
0
 
Bill PrewCommented:
I'm a bit leery to propose a generic updater for these files.  I believe they are basically well formed XML files, and as such a pure text search and replace approach could lead to errors in the xml structure in the file.  

A proper approach likely needs to work with the file as a true xml document.  One approach to this is via PowerShell as in:

http://geekswithblogs.net/nharrison/archive/2011/05/25/updating-the-machine.config--with-powershell.aspx

But I'm not really a PowerShell expert, so things like the prompting and such you want would be better handled by someone else.

You might also look at the tool based technique in this artical for additional thought:

http://learn.iis.net/page.aspx/578/package-an-application-for-the-windows-web-application-gallery/

~bp
0
 
ghelaniabhishekAuthor Commented:
Thanks for the reply bill.
Yes, these are all XML based config file.  A simple search and replace tool would also work for me if you have anything available.

two things the tool needs to do is

1) Add new tag
2) replace existing tag

while adding new tag, you need to ask for the parent tag, ie the new tag should be added within which tag

and while replacing existing tag, you can simply provide a search and replace kind of thing where we provide the entire code, you search for it and replace with the new one
0
 
JESiiCommented:
I believe Chef does it all - see http://wiki.opscode.com/display/chef/Home. Open source; highly configurable and customizable.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.