While testing some functionality for a client recently I found something interesting when publishing shared content types through the content type hub.
After initial creation of the content types and adding subscribers all seemed to work well. That is all content types were ‘pushed’ down to all the subscribers and each subscriber site could make use of the shared content types.
Once I started making changes that is where things started to get interesting. I found that for each content type hub subscriber, it creates a new timer job for each of the web application subscribers. I also found that each timer jobs only runs hourly by default. As I was working on my local development server and making changes quite regularly, I wanted a way to force updates each time I was making updates.
PowerShell to the rescue!
Here is a PSH cmdlet that I wrote that will force an update of all published content types through the content type hub each time it is run.
It will enumerate through each web application and start the MetadataSubscriberTimerJob.
Too easy!
Please feel free to modify etc as you see fit.
Here is the code:
######################################################