Contents

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!

Content what?

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!

SharePoint Online
This article is NOT applicable to SharePoint Online (in Office 365) as the Content Type Hub is already created when provisioning the tenant. It’s just hidden, but accessible at the following URL: https://<tenant_name>.sharepoint.com/sites/contenttypehub.

Minimum requirements:

  • 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

/images/sharepoint-screenshots/create-cthub-sps-img1.png
 

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

/images/sharepoint-screenshots/create-cthub-sps-img2.png
 

URL
Once you click on “OK”, the URL will NOT be changeable by going back the same way. PowerShell will need to be used!
  • Highlight the MMS Proxy
  • Click on Properties in the ribbon
  • Select “Consumes content types from the Content Type Gallery at <YOUR_CTHub_URL>

/images/sharepoint-screenshots/create-cthub-sps-img3.png
 

Verification

From a client machine, with a Site Collection Admin user:

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.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#Create the CTHub site collection
$newSPSiteSplat = @{
    Url = 'http://portal.exams.net/sites/PScthub'
    Description = "This is the site collection for the CTHub"
    Template = "STS#0"
    OwnerAlias = "exams\SPInstall"
    Name = "Content Type Hub"
    Language = 1033
    ContentDatabase = "SP2016_Portal_DB"
}
New-SPSite @newSPSiteSplat

#Enable Content Type Hub feature
Enable-SPFeature -Url "http://portal.exams.net/sites/PScthub" -Identity ContentTypeHub

 

/images/sharepoint-screenshots/create-cthub-sps-img4.png
 

/images/sharepoint-screenshots/create-cthub-sps-img5.png
 

It’s now time to associate the CTHub URL with the Managed Metadata Service Application using the Set-SPMetadataServiceApplication cmdlet:

1
2
3
4
5
#Add the CTHub URL to the MMS Application
$MMS = Get-SPServiceApplication | Where-Object {$_.TypeName -eq "Managed Metadata Service"}  
$CTHubURL = "http://portal.exams.net/sites/PScthub"

Set-SPMetadataServiceApplication -Identity $MMS -HubUri $CTHubURL

/images/sharepoint-screenshots/create-cthub-sps-img6.png
 

Update the Managed Metadata Service Proxy (connection) to consume from the CTHub URL with the Set-SPMetadataServiceApplicationProxy cmdlet:

1
2
3
4
#MMS Proxy consume CTHub & Push down Content Types
$MMSProxy = Get-SPServiceApplicationProxy| Where-Object {$_.TypeName -eq "Managed Metadata Service Connection"}  

Set-SPMetadataServiceApplicationProxy -Identity $MMSProxy -ContentTypeSyndicationEnabled -ContentTypePushdownEnabled

 

Confirm the action, and check the results!

/images/sharepoint-screenshots/create-cthub-sps-img7.png
 

That concludes the topic for today, I know it was a bit long, but I hope it was worth your time 🙂