Skip to main content

spo contenttype get

Retrieves information about the specified list or site content type

Usage​

m365 spo contenttype get [options]

Options​

-u, --webUrl <webUrl>

Absolute URL of the site where the content type is located

-l, --listTitle [listTitle]

Title of the list (if it is a list content type). Specify either listTitle, listId or listUrl.

--listId [listId]

ID of the list (if it is a list content type). Specify either listTitle, listId or listUrl.

--listUrl [listUrl]

Server- or site-relative URL of the list (if it is a list content type). Specify either listTitle, listId or listUrl.

-i, --id [id]

The ID of the content type to retrieve. Specify either id or name but not both

-n, --name [name]

The name of the content type to retrieve. Specify either id or name but not both

-h, --help [help]

Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are options, examples, remarks, response, full. Default is full.

--query [query]

JMESPath query string. See http://jmespath.org/ for more information and examples.

-o, --output [output]

Output type. json, text, csv, md. Default json.

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Remarks​

If no content type with the specified is found in the site or the list, you will get the Content type with ID 0x010012 not found error.

Examples​

Retrieve site content type by id

m365 spo contenttype get --webUrl https://contoso.sharepoint.com/sites/contoso-sales --id 0x0100558D85B7216F6A489A499DB361E1AE2F

Retrieve site content type by name

m365 spo contenttype get --webUrl https://contoso.sharepoint.com/sites/contoso-sales --name 'Document'

Retrieve list (retrieved by Title) content type

m365 spo contenttype get --webUrl https://contoso.sharepoint.com/sites/contoso-sales --listTitle Events --id 0x0100558D85B7216F6A489A499DB361E1AE2F

Retrieve list (retrieved by ID) content type

m365 spo contenttype get --webUrl https://contoso.sharepoint.com/sites/contoso-sales --listId '8c7a0fcd-9d64-4634-85ea-ce2b37b2ec0c' --id 0x0100558D85B7216F6A489A499DB361E1AE2F

Retrieve list (retrieved by URL) content type

m365 spo contenttype get --webUrl https://contoso.sharepoint.com/sites/contoso-sales --listUrl '/Shared Documents' --id 0x0100558D85B7216F6A489A499DB361E1AE2F