New command: Clears a default sensitivity label from a document library
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. |
--confirm |
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' --confirm
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
Very nice @nicodecleyre! And this is an extra reason to have the listTitle optionSet on file level as well: consistency between the commands.
I did some textual changes and opened it up 👍
May I work on this!
Awesome @ktskumar, this issue is all yours!
Hey @ktskumar, are you still working on this?
Hey @ktskumar, are you still working on this?
Yep. I missed this item from my bucket list. Will push my code asap.
@ktskumar are you still working on this?
Resetting due to lack of response