Skip to content

New command: Clears a default sensitivity label from a document library #4717

@nicodecleyre

Description

@nicodecleyre

Usage

m365 spo list sensitivitylabel remove [options]

Description

Clears a default sensitivity label from a document library

Options

Option Description
-u, --webUrl <webUrl> The URL of the site where the list is located.
-t, --listTitle [listTitle] The title of the library on which to remove the label. Specify either listTitle, listId, or listUrl but not multiple.
-l, --listId [listId] The ID of the library on which to remove the label. Specify either listTitle, listId, or listUrl but not multiple.
--listUrl [listUrl] Server- or web-relative URL of the library on which to remove the label. Specify either listTitle, listId, or listUrl but not multiple.
-f, --force Don't prompt for confirmation.

Examples

Removes a sensitivity label on a document library based on the list title

m365 spo list sensitivitylabel remove --webUrl 'https://contoso.sharepoint.com' --listTitle 'Shared Documents'

Removes a sensitivity label on a document library based on the list url

m365 spo list sensitivitylabel remove --webUrl 'https://contoso.sharepoint.com' --listUrl '/Shared Documents'

Removes a sensitivity label on a document library based on the list id. Doesn't prompt for confirmation.

m365 spo list sensitivitylabel remove --webUrl 'https://contoso.sharepoint.com' --listId 'b4cfa0d9-b3d7-49ae-a0f0-f14ffdd005f7' --force

Default properties

No response

Additional Info

This can be archieved by doing:
PATCH https://contoso.sharepoint.com/sites/testcomm/_api/web/lists(guid'[List ID]')
or PATCH https://contoso.sharepoint.com/sites/testcomm/_api/web/lists/getByTitle('[List Title]')
or PATCH https://contoso.sharepoint.com/sites/testcomm/_api/web/GetList([List server relative URL])

headers

{
     if-match: *
}

body

{
    "DefaultSensitivityLabelForLibrary": ""
}

on success the api returns a 204 No Content

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions