Skip to main content

spo list retentionlabel get

Gets the default retention label set on the specified list or library.

Usage

m365 spo list retentionlabel get [options]

Options

-u, --webUrl <webUrl>

URL of the site where the list to get the label from is located.

-l, --listId [listId]

ID of the list to get the label from. Specify either listId, listTitle, or listUrl but not multiple.

-t, --listTitle [listTitle]

Title of the list to get the label from. Specify either listId, listTitle, or listUrl but not multiple.

--listUrl [listUrl]

Server- or site-relative URL of the list. Specify either listId, listTitle, or listUrl but not multiple.

-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 options.

--query [query]

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

-o, --output [output]

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

--verbose

Runs command with verbose logging.

--debug

Runs command with debug logging.

Examples

Gets retention label set on the list with specified title located in the specified site.

m365 spo list retentionlabel get --listTitle ContosoList --webUrl https://contoso.sharepoint.com/sites/project-x

Gets retention label set on the list with specified id located in the specified site.

m365 spo list retentionlabel get --listId cc27a922-8224-4296-90a5-ebbc54da2e85 --webUrl https://contoso.sharepoint.com/sites/project-x

Gets retention label set on the list with specified server relative url located in the specified site.

m365 spo list retentionlabel get --listUrl 'sites/project-x/Documents' --webUrl https://contoso.sharepoint.com/sites/project-x

Gets retention label set on the list with specified site-relative URL located in the specified site.

m365 spo list retentionlabel get --listUrl 'Shared Documents' --webUrl https://contoso.sharepoint.com/sites/project-x

Response

{
"AcceptMessagesOnlyFromSendersOrMembers": false,
"AccessType": null,
"AllowAccessFromUnmanagedDevice": null,
"AutoDelete": false,
"BlockDelete": false,
"BlockEdit": false,
"ContainsSiteLabel": false,
"DisplayName": "Label A",
"EncryptionRMSTemplateId": null,
"HasRetentionAction": false,
"IsEventTag": false,
"Notes": null,
"RequireSenderAuthenticationEnabled": false,
"ReviewerEmail": null,
"SharingCapabilities": null,
"SuperLock": false,
"TagDuration": 0,
"TagId": "4d535433-2a7b-40b0-9dad-8f0f8f3b3841",
"TagName": "Sensitive",
"TagRetentionBasedOn": null
}
CTRL + M