Get Content Type ID SharePoint 2016 Using PowerShell

In this post, we will learn how to Get Content Type ID in SharePoint 2016 Using PowerShell?


How to Get Content Type ID SharePoint 2016 Using PowerShell?

If you have tried to create a custom action for a specific SharePoint content type, you will need to set the RegistrationId value to the content type as shown below:

Custom Action list for a Content Type

In this case, you have two options to get Get SharePoint Content Type ID

  1. Get SharePoint Content Type ID as OOTB.
  2. Get SharePoint Content Type ID using PowerShell.

Get Content Type ID SharePoint (OOTB)

  • Open the custom list that has the content type.
  • Go to List Settings. (Make sure that the content types has been allowed).
  • Advanced Settings > Allow management of content types.
allow management of content types
  • Below the Content Types Click on your Content-Type.
Content types list
  • Here you can get the List Content Type.
http://RootSite/_layouts/15/ManageContentType.aspx?List=%7B9BFE9A3B%2DB7F8%2D4A61%2D8088%2D104DD333BEB7%7D&ctype=0x0100E076A4E49D4B5D47BDF993EC507AE0020049781978ADA96741B13B3D112904E4B5
Get Content Type ID SharePoint from URL
  • Click On Parent to get the Site Content Type.
http://RootSite/_layouts/15/ManageContentType.aspx?ctype=0x0100E076A4E49D4B5D47BDF993EC507AE002
site content type

Get Content Type ID SharePoint using PowerShell

here, we will show how to

  • Get All Content Types in SharePoint Site.
  • Get Content Type ID by Content Type Name in SharePoint Site

Get All Content Types in SharePoint Site

  • Open SharePoint Management Shell as Administrator.
Open SharePoint 2016 PowerShell - Upgrade and Migrate to Project Server 2016
  • Run the below script one by one with your own site URL
$site = Get-SPSite -Identity http://RootSite/
$web = $site.OpenWeb("YourSite")
ForEach($ctype in $web.ContentTypes){write-host $ctype.Name": "$ctype.ID}

Output

CustomActionCT : 0x0100E076A4E49D4B5D47BDF993EC507AE002
Get Content Type ID SharePoint 2016 Using PowerShell

Get Content Type ID by Name in SharePoint Site

  • Open SharePoint Management Shell as Administrator.
Open SharePoint 2016 PowerShell - Upgrade and Migrate to Project Server 2016
  • Run the below script one by one with your own site URL, and the content type name
$site = Get-SPSite -Identity http://epm/
$web = $site.OpenWeb("workflow")
ForEach($ctype in $web.ContentTypes){write-host $ctype.Name": "$ctype.ID | Where-Object {$ctype.Name -eq 'Contet Type Name'}}

Output

CustomActionCT : 0x0100E076A4E49D4B5D47BDF993EC507AE002
Get Content Type ID by Name in SharePoint Site

Applies To
  • SharePoint 2016
  • SharePoint 2013
See Also

1 thought on “Get Content Type ID SharePoint 2016 Using PowerShell”

Leave a Reply