In this post, we will learn how to Get Content Type ID in 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:
In this case, you have two options to get Get SharePoint Content Type ID
- Get SharePoint Content Type ID as OOTB.
- Get SharePoint Content Type ID using PowerShell.
- 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.
- Below the Content Types Click on your Content-Type.
- Here you can get the List Content Type.
http://RootSite/_layouts/15/ManageContentType.aspx?List=%7B9BFE9A3B%2DB7F8%2D4A61%2D8088%2D104DD333BEB7%7D&ctype=0x0100E076A4E49D4B5D47BDF993EC507AE0020049781978ADA96741B13B3D112904E4B5
- Click On Parent to get the Site Content Type.
http://RootSite/_layouts/15/ManageContentType.aspx?ctype=0x0100E076A4E49D4B5D47BDF993EC507AE002
here, we will show how to
- Get All Content Types in SharePoint Site.
- Get Content Type ID by Content Type Name in SharePoint Site
- Open SharePoint Management Shell as Administrator.
- 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
- Open SharePoint Management Shell as Administrator.
- 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
Applies To
- SharePoint 2016
- SharePoint 2013
Nice one!