Introduction
One of the great things about Content Types are that you can have a document template associated to the Content Type.
This means that when you create a new document a customised word template with its own look and feel can be used to guide the user through the process of filling the document and setting up the content type’s metadata.
Recently, we had the situation where we had content types being used across lots of site collections each for the different departments in the organisation.
One of the management overheads is when a document template needs to be updated. How can you do that programmatically using PowerShell?
Well the following script helps you get that done.
Solution
The PowerShell Script, Update-SPContentTypeDocumentTemplate.ps1 below does just that.
So how do you use it?
Well you provide the URL of the site, the path to the document template and also the name of the Content Type.
It will access the site, check if the content type already has a document template, upload the selected document and configure the content type to use the new document template.
You can decide if you want to update all the child content types which have been assigned to document libraries. if you want to do this which is recommended then make sure you include the -UpdateChild switch.
Example
| .\Update-SPContentTypeDocumentTemplate.ps1 –Url https://sharepoint -ContentTypeName "Policy Document" -DocumentTemplatePath "c:\dev\documents\policydocumenttemplate.dotx" -DocumentTemplateFileName "policydocumenttemplatev2.dotx" -UpdateChildren |
So what would happen if you wanted to update a number of sites?
Well you can just get a list of the sites and pipe that array into the command and it will update the content type on each site.
Also the same technique could be used to update multiple content types on a number of sites.
Download Script
The PowerShell Script is part of the iThink SharePoint PowerShell GitHub Repository, which can be found here:
https://github.com/ithinksharepoint/PowerShell
Anyway, I hope you find the solution useful, please let me know if you did and also if you have some additions or changes then please share them!
All the best
Simon

