Create the ContentType Hub in SharePoint Server (GUI & PowerShell)
Today’s post will be a bit long. But at the end, you’ll understand what is the Content Type Hub, its purpose, and how to create it in 2 different ways!
In order to understand the purpose of the Content Type Hub, we first need to understand Content Types. This is a rather confusing topic for many of us, but content types are used to provide more information about an object/item, and allow us to associate some actions with that content type (i.e.: Workflows) To get started with Content Types, have a look at Introduction to content types and content type publishing.
Content Types are only available hierarchically, and also, only within a particular Site Collection. So if we want to share Content Types, that’s when the Content Type Hub comes into play 🙂
What is the Content Type Hub for?
The Content Type Hub allows us to “bypass” the boundaries of Site Collections, and share/publish content types with other site collections, and even other SharePoint Farms. As long as the Web Applications are connected to the Managed Metadata Service Application hosting the CTHub, they can consume the content types.
Therefore, we avoid doing things over and over again, by NOT creating the same content types multiple times!
- Access to SharePoint Central Admin
- Managed Metadata Service Application created
- Permissions to manage the Managed Metadata Service Application
- Permissions to run PowerShell cmdlets
Create the ContentType Hub via Central Admin
The Content Type Hub is nothing more than a Site Collection.
Meaning we can create it on a existing Web Application, or create a new Web Application to host the Content Type Hub site collection. Your choice!
In this post, we will create the Content Type Hub into a existing Web Application called “Portal”.
- Navigate to SharePoint Central Admin
- Under Application Management –> Create site collections
- Make sure you are under the desired Web Application at the top –> Fill the information (mine below as a reference)
- Then click OK
We now need to activate the Content Type Syndication Hub feature on this site collection, to make it the CTHub.
- Browse to the CTHub site collection (mine is: http://portal.exams.net/sites/cthub)
- Gear icon (top right) –> Site Settings
- Under Site Collection Administration –> Site collection features
- Activate the Content Type Syndication Hub feature
Perfect! Now let’s connect the CTHub site collection to the Managed Metadata Service Application.
- Back to Central Admin
- Under Application Management » Manage service applications
- Highlight the MMS application » Click on Properties in the ribbon
- At the bottom of the page –> Enter the URL of the Content Type Hub
- Click OK
- Highlight the MMS Proxy
- Click on Properties in the ribbon
- Select “Consumes content types from the Content Type Gallery at <YOUR_CTHub_URL>“
From a client machine, with a Site Collection Admin user:
- Browse to a Site Collection –> Site Settings
- Under Site Collection Administration –> Click on Content Type Publishing
- Note the URL under “Hubs” –> http://portal.exams.net/sites/cthub/_layouts/15/mngctype.aspx
And that’s it!
The Content Type Hub is now created and available for you to publish Content Types beyond their respective site collections.
Create the ContentType Hub via PowerShell
We are going to follow the exact same pattern here, as we did above via Central Admin (GUI)
- Create the Content Type Hub site collection (under the existing “Portal” Web Application),
- Activate the Content Type Syndication Hub feature on the site collection,
- Associate the Content Type Hub with the Managed Metadata Service Application
- Update the MMS Proxy (connection) to consume the Content Type Gallery from the CTHub URL
As usual, adapt the script with your environment.
It’s now time to associate the CTHub URL with the Managed Metadata Service Application using the
Update the Managed Metadata Service Proxy (connection) to consume from the CTHub URL with the
Confirm the action, and check the results!
That concludes the topic for today, I know it was a bit long, but I hope it was worth your time 🙂