Skip to content

spo list contenttype default set

Sets the default content type for a list

Usage

m365 spo list contenttype default set [options]

Options

-u, --webUrl <webUrl>
URL of the site where the list is located
-l, --listId [listId]
ID of the list on which to set default content type, specify listId or listTitle but not both
-t, --listTitle [listTitle]
Title of the list on which to set default content type, specify listId or listTitle but not both
-c, --contentTypeId <contentTypeId>
ID of the content type to set as default on the list
-h, --help
output usage information
--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples
-o, --output [output]
Output type. json,text. Default text
--verbose
Runs command with verbose logging
--debug
Runs command with debug logging

Examples

Set content type with ID 0x0120 as default in the list with ID 0cd891ef-afce-4e55-b836-fce03286cccf located in site https://contoso.sharepoint.com/sites/project-x

m365 spo list contenttype default set --webUrl https://contoso.sharepoint.com/sites/project-x --listId 0cd891ef-afce-4e55-b836-fce03286cccf --contentTypeId 0x0120

Set content type with ID 0x0120 as default in the list with title Documents located in site https://contoso.sharepoint.com/sites/project-x

m365 spo list contenttype default set --webUrl https://contoso.sharepoint.com/sites/project-x --listTitle Documents --contentTypeId 0x0120