Change Content Type Hub URL in Managed Metadata Services using PowerShell
Problem: In a Migration project, after backup-restoring the MMS Service application, I found that the Managed Metadata Service application still referred to the old SharePoint 2010’s content type hub URL. Unfortunately, there is no way to update the content type hub URL in SharePoint 2013 Managed metadata services!
The same issue arises when you change your existing content type hub site! If you have not assigned any content type hub in the managed metadata service application already, setting it up is pretty straightforward.
How to Set Content Type Hub URL in Managed Metadata Service Application?
Follow these steps to change the content type hub in SharePoint:
- Go to Central Administration >> click the Application Management >> under Service Applications, Select Managed Metadata Service >> Click on Properties from the ribbon.
- In Managed metadata service application properties, Enter your Content Type Hub site collection URL in Content Type, such as: https://intranet.crescent.com/ctypehub.
- Also, select the Managed Metadata Service Connection >> Click on Properties from the ribbon, and set “Consume content type from the content type gallery”. That’s all.
But if the content type hub is already assigned, then this property stays read only!
Change managed metadata content hub URL:
Content type hub in SharePoint allows centralized management of content types through Managed metadata service. There is no UI to change content type hub URL in SharePoint 2010 or in SharePoint 2013. However, We can utilize PowerShell to change the content type hub URL of a managed metadata service. Here is my script:
PowerShell Script to change Content Type hub URL in SharePoint:
Add-PSSnapin Microsoft.SharePoint.Powershell -ErrorAction SilentlyContinue #Managed Metadata Service Application Name $MMSAppName="Managed Metadata Service" #New location of Content Type Hub $ContentTypeHub ="https://intranet.crescent.com/sites/CtypeHub" #set content type hub PowerShell Set-SPMetadataServiceApplication -Identity $MMSAppName -HubURI $ContentTypeHub Write-host "Content Type location updated!"
You’ll be prompted to confirm. Once confirmed, This PowerShell script changes content type hub URL in SharePoint 2013!