在站点中查找来自内容类型中心并且正在使用Powershell的内容类型 [英] Find content types in a site which are coming from content type hub and being used using powershell
问题描述
大家好,
我需要确定订阅站点中是否确实使用了内容类型中心中的内容类型.
I have a requirement to find if content types from content type hub are really being used in subscribing sites. Can this be done using powershell?
推荐答案
1.正如我测试的那样,对于Content Type对象,没有属性可以指定它来自Content Type Hub网站还是原始网站集本身,因此PowerShell无法做到这一点.
1. As I tested, for a Content Type object, there is no property which will specify where it comes from a Content Type Hub site or the original site collection itself, so this is not possible by PowerShell.
一种解决方法是您可以在用户界面中对此进行区分.
A workaround is that you can distinguish this in the UI.
对于内容类型"来自内容类型中心",它将仅具有高级设置":
For the Content Type comes from Content Type Hub, it will only have Advanced Settings:
对于在网站设置"中创建的普通内容类型",它将在设置"中具有多个选项:
For Normal Content Type created in Site Settings, it will have multiple options in Settings:
2.使用PowerShell脚本检查网站集中是否使用了特定的内容类型:
2. Use PowerShell script to check if a specific Content Type is used in a site collection:
dd-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
#Get the site
site = Get-SPSite"http://sharepoint.crescent.com/sites/marketing"; #Content Type的名称
site = Get-SPSite "http://sharepoint.crescent.com/sites/marketing" #Name of the Content Type
ContentTypeName =旅行请求"; #遍及整个网络 Foreach(
ContentTypeName = "Travel Request" #Loop through all web Foreach (
这篇关于在站点中查找来自内容类型中心并且正在使用Powershell的内容类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!