purview sensitivitylabel get
Retrieve the specified sensitivity label
Usage
m365 purview sensitivitylabel get [options]
Options
-i, --id <id>
The Id of the sensitivity label.
--userId [userId]
User's Microsoft Entra ID. Optionally specify this if you want to get a list of sensitivity labels that the user has access to. Specify either
userId
oruserName
but not both.--userName [userName]
User's UPN (user principal name, e.g. johndoe@example.com). Optionally specify this if you want to get a list of sensitivity labels that the user has access to. Specify either
userId
oruserName
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 isoptions
.--query [query]
JMESPath query string. See http://jmespath.org/ for more information and examples.
-o, --output [output]
Output type.
json
,text
,csv
,md
,none
. Defaultjson
.--verbose
Runs command with verbose logging.
--debug
Runs command with debug logging.
Remarks
This command is based on a Microsoft Graph API that is currently in preview and is subject to change once the API reached general availability.
When operating in app-only mode, you have the option to use either the userName
or userId
parameters to retrieve the sensitivity policy settings for a specific user. Without specifying either of these parameters, the command will retrieve the sensitivity policy settings for the currently authenticated user when operating in delegated mode.
Examples
Get a sensitivity label.
m365 purview sensitivitylabel get --id 6f4fb2db-ecf4-4279-94ba-23d059bf157e
Get a sensitivity label that a specific user has access to by its Id.
m365 purview sensitivitylabel get --id 6f4fb2db-ecf4-4279-94ba-23d059bf157e --userId 59f80e08-24b1-41f8-8586-16765fd830d3
Get a sensitivity label that a specific user has access to by its UPN.
m365 purview sensitivitylabel get --id 6f4fb2db-ecf4-4279-94ba-23d059bf157e --userName john.doe@contoso.com
Response
- JSON
- Text
- CSV
- Markdown
{
"id": "6f4fb2db-ecf4-4279-94ba-23d059bf157e",
"name": "Unrestricted",
"description": "",
"color": "",
"sensitivity": 0,
"tooltip": "Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.",
"isActive": true,
"isAppliable": true,
"contentFormats": [
"file",
"email"
],
"hasProtection": false
}
color :
contentFormats: ["file","email"]
description :
hasProtection : false
id : 6f4fb2db-ecf4-4279-94ba-23d059bf157e
isActive : true
isAppliable : true
name : Unrestricted
sensitivity : 0
tooltip : Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.
id,name,description,color,sensitivity,tooltip,isActive,isAppliable,contentFormats,hasProtection
6f4fb2db-ecf4-4279-94ba-23d059bf157e,Unrestricted,,,0,"Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.",1,1,"[""file"",""email""]",
# purview sensitivitylabel get --id "6f4fb2db-ecf4-4279-94ba-23d059bf157e"
Date: 3/25/2023
## Unrestricted (6f4fb2db-ecf4-4279-94ba-23d059bf157e)
Property | Value
---------|-------
id | 6f4fb2db-ecf4-4279-94ba-23d059bf157e
name | Unrestricted
description |
color |
sensitivity | 0
tooltip | Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.
isActive | true
isAppliable | true
hasProtection | false