Updating content type templates on 9000 libraries...

Occasional Contributor

Hi everyone - I wanted to see if any of you have experienced the issue that I am currently faced with, and if you have any suggestions for how I can get out of the difficulty that we're in!


We have a SharePoint site with 9,000 document libraries. Each of these libraries contains a standard set of ~15 content types. Each of these content types has a document template associated with it.


The problem we have is that, if I try and update the template on any of these content types, it just says "Working on it" and never completes, because it turns out the template is physically copied to each library, and the level of processing involved in replacing them all seems to cause SharePoint to treat it like a denial of service, and blocks completion (I've left it running for 36 hours, and it still didn't complete).


Microsoft state that there is no limit to the number of libraries you can have on a site, and there is no documentation (at least none that I, or the MS rep from their support can find) stating limitations to content types on these libraries.


We're in difficulty now because this is a business critical solution that requires regular updates to document templates, but SharePoint won't let us do it (including with Powershell).


Has anyone else seen this issue, and if so do you have a solution? Or any ideas generally would be gratefully received!!





6 Replies



Which version of SP are you working with and can you describe how you are doing this update? Do the templates include document properties?


In modern SP there are two ways of using document templates:


  1. by configuring the content type through the content type advanced settings (the "classic" way). This connects a template to a specific content type.
  2. by uploading templates to the library (the "modern" way). This way you can select whatever template you want and then define the content type when editing the document properties.


@Maggan Wåhlin Thanks very much for coming back to me :)


This is using modern team sites in SharePoint Online. When we originally configured it, we had a series of content types, each with properties associated (mostly connecting to Managed Metadata sources). Each content type had a document template applied to it (through the advanced settings of the CT, and uploading a file). The issue now is, because of the volume of libraries in there, if I try and replace that document template in the content type, it just hangs on "Working on it". I noticed that SharePoint copies this template to each library, so when replacing it, it first has to delete it everywhere, and then replace it with the new one, and this is where we have the problem. SharePoint seems to treat this like some kind of DoS potential, and hangs on it.


Any thoughts?


Thanks again






I agree that it probably has to do with the large volume doc libs...


Maybe PowerShell could help you? Found an article on this here: https://simondoy.com/2016/05/24/powershell-update-sharepoint-content-type-document-template-script/


@Maggan Wåhlin 


We thought that too, and tried it using Powershell. The problem is that when it tries to push this out to 9000 libraries, SharePoint then blocks it, and waits between each operation (because of the large amount of activity it's a potential performance threat). Each time it doubles the amount of time it waits, which is then an ever-increasing number. Last time I gave up after running the update for 36 hours straight :(





A few months ago, I had a similar issue. We were updating metadata for a couple of thousand docs and it caused a hang up. We later identified that if a document was opened by a user, that document got locked and caused the script to fail after a lot of attempts. Have you tried making sure that all docs are closed and not checked out by any user before doing the update? Guess this might be difficult because of the huge amount of libs and docs in your case though...


I´m sorry, this is the last thing I can come up with for now... 


@Maggan Wåhlin 


That's a very good point, and one that we can look into as well.


We've come up with another potential thought, which is to use a script to manually update the content type in-place on every library (1000 at a time, to avoid throttling) so that the document template instead points to a URL of a document in a central library (rather than being attached to the content type itself). Once done, manually update the master content type with the same, but tell it not to push the changes out when saved. This way all new libraries created with these content types therefore inherit the same settings.


This might cause us problems down the line if we must change the content type and push changes out, but it at least gives us a short-term fix so that the templates can be updated (which is the urgent requirement).


Thanks for your help :)