If you want to write a script to add new or update existing configuration, no matter what configuration file it belongs to (e.g. administration.config, applicationHost.config or website or application specific web.config), you can install Configuration Editor, which is a part of the IIS Admin Pack and use “Generate script” feature, just of its numerous great features.
In order to download this and read more about this please click on below links.