Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7992325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:31:49+00:00 2026-06-04T13:31:49+00:00

How do I flush out invalid SPWebConfigModifications? I tried to execute some invalid modifications

  • 0

How do I flush out invalid SPWebConfigModifications?

I tried to execute some invalid modifications as part of a solution and now I cannt get rid of them, everytime I run ApplyWebConfigModifications it tries to execute the invalid modifications.

How do flush them out of the system?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T13:31:51+00:00Added an answer on June 4, 2026 at 1:31 pm

    For future reference (after banging my head on the wall for 3 days):

    You can use this tool:

    http://ianankers.wordpress.com/2011/07/14/web-config-modification-manager-for-sharepoint-2010/

    It will list all the mods for every WebApp installed in your farm, you can add new ones and remove old ones.

    The tool will only list modifications at webapp level, if you installed mods at the farm level you need to run a script like:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.SharePoint;
    using Microsoft.SharePoint.Navigation;
    using Microsoft.SharePoint.Administration;
    
    namespace ModTool
    {
        class Program
        {
            static void Main(string[] args)
            {
    
                SPSite site = new SPSite(args[0]);
                SPWebService service = site.WebApplication.Farm.Services.GetValue<SPWebService>();
    
    
                if (args.Length == 1 || string.IsNullOrEmpty(args[1]))
                {
                    Console.Out.WriteLine("Listing all Mods and Owners");
                    foreach (SPWebConfigModification mod in service.WebConfigModifications)
                    {
                        Console.Out.WriteLine("Mod:" + mod.Name + ", Owner:" + mod.Owner);
                    }
                }
                else
                {
                    Console.Out.WriteLine("Removing all mods owner:" + args[1] + ", reference site:" + args[0]);
    
                    List<SPWebConfigModification> toDelete = new List<SPWebConfigModification>();
    
                    foreach (SPWebConfigModification mod in service.WebConfigModifications)
                    {
                        if (mod.Owner == args[1])
                        {
                            toDelete.Add(mod);
                        }
                    }
    
                    Console.Out.WriteLine("Found " + toDelete.Count + "Mods");
    
    
    
                    foreach (SPWebConfigModification mod in toDelete)
                    {
                        service.WebConfigModifications.Remove(mod);
                    }
                    service.Update();
                    SPWebService.ContentService.ApplyWebConfigModifications();
                    Console.Out.WriteLine("Done!!");
                }
            }
        }
    }
    

    Usage:

    ModTool http://site - List all the mods for the farm, site is just an entry point
    ModTool http://site owner -Deletes all the mods for the far wich owner is "owner"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

byte[] data = (byte[])opBinding.execute(); PrintWriter out = new PrintWriter(outputStream); out.println(data); out.flush(); out.close(); but instead
I get Length of the data to decrypt is invalid. exception when i try
The error i want to show flash[:error] = Invalid username/password combination. I've tried $(document).ready(
I want to flush out a file buffer before executing $finish in my simulation.
I am trying to fade out a Flash embed object and fade in regular
you all know: right click -> zoom in or out in flash file, well,
Are there any products out there that convert Flash SWFs to XAML (I'm interested
I'm making a bot for a Flash game, and I've figured out how to
How do I flush certain parts of a session but not other parts? For
What does sys.stdout.flush() do?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.