@pnp/cli-microsoft365 6.8.0-beta.9f8a015 → 6.8.0-beta.c5c3c32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/.eslintrc.js +2 -0
  2. package/dist/m365/commands/commands.js +1 -0
  3. package/dist/m365/commands/docs.js +42 -0
  4. package/dist/m365/commands/login.js +1 -1
  5. package/dist/m365/pa/commands/app/app-consent-set.js +101 -0
  6. package/dist/m365/pa/commands.js +1 -0
  7. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-get.js +97 -0
  8. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-list.js +85 -0
  9. package/dist/m365/purview/commands/sensitivitylabel/sensitivitylabel-policysettings-list.js +89 -0
  10. package/dist/m365/purview/commands.js +3 -0
  11. package/dist/m365/spo/commands/file/file-list.js +15 -4
  12. package/dist/m365/spo/commands/file/file-remove.js +3 -0
  13. package/dist/m365/spo/commands/term/term-get.js +14 -5
  14. package/dist/m365/spo/commands/term/term-group-list.js +39 -4
  15. package/dist/m365/spo/commands/term/term-list.js +18 -9
  16. package/dist/m365/spo/commands/term/term-set-get.js +12 -3
  17. package/dist/m365/spo/commands.js +1 -0
  18. package/docs/docs/cmd/aad/o365group/o365group-get.md +0 -12
  19. package/docs/docs/cmd/docs.md +51 -0
  20. package/docs/docs/cmd/pa/app/app-consent-set.md +47 -0
  21. package/docs/docs/cmd/planner/task/task-get.md +0 -6
  22. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-get.md +118 -0
  23. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-list.md +111 -0
  24. package/docs/docs/cmd/purview/sensitivitylabel/sensitivitylabel-policysettings-list.md +97 -0
  25. package/docs/docs/cmd/spo/file/file-list.md +9 -6
  26. package/docs/docs/cmd/spo/file/file-remove.md +12 -0
  27. package/docs/docs/cmd/spo/term/term-get.md +111 -10
  28. package/docs/docs/cmd/spo/term/term-group-list.md +70 -2
  29. package/docs/docs/cmd/spo/term/term-list.md +80 -8
  30. package/docs/docs/cmd/spo/term/term-set-get.md +92 -8
  31. package/package.json +1 -1
@@ -8,10 +8,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _SpoTermGroupListCommand_instances, _SpoTermGroupListCommand_initTelemetry, _SpoTermGroupListCommand_initOptions, _SpoTermGroupListCommand_initValidators;
11
17
  Object.defineProperty(exports, "__esModule", { value: true });
12
18
  const config_1 = require("../../../../config");
13
19
  const request_1 = require("../../../../request");
14
20
  const spo_1 = require("../../../../utils/spo");
21
+ const validation_1 = require("../../../../utils/validation");
15
22
  const SpoCommand_1 = require("../../../base/SpoCommand");
16
23
  const commands_1 = require("../../commands");
17
24
  class SpoTermGroupListCommand extends SpoCommand_1.default {
@@ -24,16 +31,23 @@ class SpoTermGroupListCommand extends SpoCommand_1.default {
24
31
  defaultProperties() {
25
32
  return ['Id', 'Name'];
26
33
  }
27
- commandAction(logger) {
34
+ constructor() {
35
+ super();
36
+ _SpoTermGroupListCommand_instances.add(this);
37
+ __classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initTelemetry).call(this);
38
+ __classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initOptions).call(this);
39
+ __classPrivateFieldGet(this, _SpoTermGroupListCommand_instances, "m", _SpoTermGroupListCommand_initValidators).call(this);
40
+ }
41
+ commandAction(logger, args) {
28
42
  return __awaiter(this, void 0, void 0, function* () {
29
43
  try {
30
- const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
31
- const res = yield spo_1.spo.getRequestDigest(spoAdminUrl);
44
+ const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
45
+ const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
32
46
  if (this.verbose) {
33
47
  logger.logToStderr(`Retrieving taxonomy term groups...`);
34
48
  }
35
49
  const requestOptions = {
36
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
50
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
37
51
  headers: {
38
52
  'X-RequestDigest': res.FormDigestValue
39
53
  },
@@ -61,5 +75,26 @@ class SpoTermGroupListCommand extends SpoCommand_1.default {
61
75
  });
62
76
  }
63
77
  }
78
+ _SpoTermGroupListCommand_instances = new WeakSet(), _SpoTermGroupListCommand_initTelemetry = function _SpoTermGroupListCommand_initTelemetry() {
79
+ this.telemetry.push((args) => {
80
+ Object.assign(this.telemetryProperties, {
81
+ webUrl: typeof args.options.webUrl !== 'undefined'
82
+ });
83
+ });
84
+ }, _SpoTermGroupListCommand_initOptions = function _SpoTermGroupListCommand_initOptions() {
85
+ this.options.unshift({
86
+ option: '-u, --webUrl [webUrl]'
87
+ });
88
+ }, _SpoTermGroupListCommand_initValidators = function _SpoTermGroupListCommand_initValidators() {
89
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
90
+ if (args.options.webUrl) {
91
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
92
+ if (isValidSharePointUrl !== true) {
93
+ return isValidSharePointUrl;
94
+ }
95
+ }
96
+ return true;
97
+ }));
98
+ };
64
99
  module.exports = new SpoTermGroupListCommand();
65
100
  //# sourceMappingURL=term-group-list.js.map
@@ -44,22 +44,22 @@ class SpoTermListCommand extends SpoCommand_1.default {
44
44
  commandAction(logger, args) {
45
45
  return __awaiter(this, void 0, void 0, function* () {
46
46
  try {
47
- const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
48
- const res = yield spo_1.spo.getRequestDigest(spoAdminUrl);
47
+ const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
48
+ const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
49
49
  if (this.verbose) {
50
50
  logger.logToStderr(`Retrieving taxonomy term sets...`);
51
51
  }
52
52
  const termGroupQuery = args.options.termGroupId ? `<Method Id="77" ParentId="75" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="77" ParentId="75" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
53
53
  const termSetQuery = args.options.termSetId ? `<Method Id="82" ParentId="80" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termSetId}}</Parameter></Parameters></Method>` : `<Method Id="82" ParentId="80" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termSetName)}</Parameter></Parameters></Method>`;
54
54
  const data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="70" ObjectPathId="69" /><ObjectIdentityQuery Id="71" ObjectPathId="69" /><ObjectPath Id="73" ObjectPathId="72" /><ObjectIdentityQuery Id="74" ObjectPathId="72" /><ObjectPath Id="76" ObjectPathId="75" /><ObjectPath Id="78" ObjectPathId="77" /><ObjectIdentityQuery Id="79" ObjectPathId="77" /><ObjectPath Id="81" ObjectPathId="80" /><ObjectPath Id="83" ObjectPathId="82" /><ObjectIdentityQuery Id="84" ObjectPathId="82" /><ObjectPath Id="86" ObjectPathId="85" /><Query Id="87" ObjectPathId="85"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties><Property Name="Name" ScalarProperty="true" /><Property Name="Id" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><ObjectPaths><StaticMethod Id="69" Name="GetTaxonomySession" TypeId="{981cbc68-9edc-4f8d-872f-71146fcbb84f}" /><Method Id="72" ParentId="69" Name="GetDefaultSiteCollectionTermStore" /><Property Id="75" ParentId="72" Name="Groups" />${termGroupQuery}<Property Id="80" ParentId="77" Name="TermSets" />${termSetQuery}<Property Id="85" ParentId="82" Name="Terms" /></ObjectPaths></Request>`;
55
- const result = yield this.executeCsomCall(data, spoAdminUrl, res);
55
+ const result = yield this.executeCsomCall(data, spoWebUrl, res);
56
56
  const terms = [];
57
57
  if (result._Child_Items_ && result._Child_Items_.length > 0) {
58
58
  for (const term of result._Child_Items_) {
59
59
  this.setTermDetails(term);
60
60
  terms.push(term);
61
61
  if (args.options.includeChildTerms && term.TermsCount > 0) {
62
- yield this.getChildTerms(spoAdminUrl, res, term);
62
+ yield this.getChildTerms(spoWebUrl, res, term);
63
63
  }
64
64
  }
65
65
  }
@@ -108,17 +108,17 @@ class SpoTermListCommand extends SpoCommand_1.default {
108
108
  }
109
109
  });
110
110
  }
111
- getChildTerms(spoAdminUrl, res, parentTerm) {
111
+ getChildTerms(spoWebUrl, res, parentTerm) {
112
112
  return __awaiter(this, void 0, void 0, function* () {
113
113
  parentTerm.Children = [];
114
114
  const data = `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="20" ObjectPathId="19" /><Query Id="21" ObjectPathId="19"><Query SelectAllProperties="false"><Properties /></Query><ChildItemQuery SelectAllProperties="true"><Properties><Property Name="CustomSortOrder" ScalarProperty="true" /><Property Name="CustomProperties" ScalarProperty="true" /><Property Name="LocalCustomProperties" ScalarProperty="true" /></Properties></ChildItemQuery></Query></Actions><ObjectPaths><Property Id="19" ParentId="16" Name="Terms" /><Identity Id="16" Name="${parentTerm._ObjectIdentity_}" /></ObjectPaths></Request>`;
115
- const result = yield this.executeCsomCall(data, spoAdminUrl, res);
115
+ const result = yield this.executeCsomCall(data, spoWebUrl, res);
116
116
  if (result._Child_Items_ && result._Child_Items_.length > 0) {
117
117
  for (const term of result._Child_Items_) {
118
118
  this.setTermDetails(term);
119
119
  parentTerm.Children.push(term);
120
120
  if (term.TermsCount > 0) {
121
- yield this.getChildTerms(spoAdminUrl, res, term);
121
+ yield this.getChildTerms(spoWebUrl, res, term);
122
122
  }
123
123
  }
124
124
  }
@@ -132,10 +132,10 @@ class SpoTermListCommand extends SpoCommand_1.default {
132
132
  parseTermDateToIsoString(dateAsString) {
133
133
  return new Date(Number(dateAsString.replace('/Date(', '').replace(')/', ''))).toISOString();
134
134
  }
135
- executeCsomCall(data, spoAdminUrl, res) {
135
+ executeCsomCall(data, spoWebUrl, res) {
136
136
  return __awaiter(this, void 0, void 0, function* () {
137
137
  const requestOptions = {
138
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
138
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
139
139
  headers: {
140
140
  'X-RequestDigest': res.FormDigestValue
141
141
  },
@@ -154,6 +154,7 @@ class SpoTermListCommand extends SpoCommand_1.default {
154
154
  _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry = function _SpoTermListCommand_initTelemetry() {
155
155
  this.telemetry.push((args) => {
156
156
  Object.assign(this.telemetryProperties, {
157
+ webUrl: typeof args.options.webUrl !== 'undefined',
157
158
  termGroupId: typeof args.options.termGroupId !== 'undefined',
158
159
  termGroupName: typeof args.options.termGroupName !== 'undefined',
159
160
  termSetId: typeof args.options.termSetId !== 'undefined',
@@ -163,6 +164,8 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
163
164
  });
164
165
  }, _SpoTermListCommand_initOptions = function _SpoTermListCommand_initOptions() {
165
166
  this.options.unshift({
167
+ option: '-u, --webUrl [webUrl]'
168
+ }, {
166
169
  option: '--termGroupId [termGroupId]'
167
170
  }, {
168
171
  option: '--termGroupName [termGroupName]'
@@ -175,6 +178,12 @@ _SpoTermListCommand_instances = new WeakSet(), _SpoTermListCommand_initTelemetry
175
178
  });
176
179
  }, _SpoTermListCommand_initValidators = function _SpoTermListCommand_initValidators() {
177
180
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
181
+ if (args.options.webUrl) {
182
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
183
+ if (isValidSharePointUrl !== true) {
184
+ return isValidSharePointUrl;
185
+ }
186
+ }
178
187
  if (args.options.termGroupId && !validation_1.validation.isValidGuid(args.options.termGroupId)) {
179
188
  return `${args.options.termGroupId} is not a valid GUID`;
180
189
  }
@@ -40,15 +40,15 @@ class SpoTermSetGetCommand extends SpoCommand_1.default {
40
40
  commandAction(logger, args) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
42
  try {
43
- const spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
44
- const res = yield spo_1.spo.getRequestDigest(spoAdminUrl);
43
+ const spoWebUrl = args.options.webUrl ? args.options.webUrl : yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
44
+ const res = yield spo_1.spo.getRequestDigest(spoWebUrl);
45
45
  if (this.verbose) {
46
46
  logger.logToStderr(`Retrieving taxonomy term set...`);
47
47
  }
48
48
  const termGroupQuery = args.options.termGroupId ? `<Method Id="62" ParentId="60" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.termGroupId}}</Parameter></Parameters></Method>` : `<Method Id="62" ParentId="60" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.termGroupName)}</Parameter></Parameters></Method>`;
49
49
  const termSetQuery = args.options.id ? `<Method Id="67" ParentId="65" Name="GetById"><Parameters><Parameter Type="Guid">{${args.options.id}}</Parameter></Parameters></Method>` : `<Method Id="67" ParentId="65" Name="GetByName"><Parameters><Parameter Type="String">${formatting_1.formatting.escapeXml(args.options.name)}</Parameter></Parameters></Method>`;
50
50
  const requestOptions = {
51
- url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
51
+ url: `${spoWebUrl}/_vti_bin/client.svc/ProcessQuery`,
52
52
  headers: {
53
53
  'X-RequestDigest': res.FormDigestValue
54
54
  },
@@ -77,6 +77,7 @@ class SpoTermSetGetCommand extends SpoCommand_1.default {
77
77
  _SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelemetry = function _SpoTermSetGetCommand_initTelemetry() {
78
78
  this.telemetry.push((args) => {
79
79
  Object.assign(this.telemetryProperties, {
80
+ webUrl: typeof args.options.webUrl !== 'undefined',
80
81
  id: typeof args.options.id !== 'undefined',
81
82
  name: typeof args.options.name !== 'undefined',
82
83
  termGroupId: typeof args.options.termGroupId !== 'undefined',
@@ -85,6 +86,8 @@ _SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelem
85
86
  });
86
87
  }, _SpoTermSetGetCommand_initOptions = function _SpoTermSetGetCommand_initOptions() {
87
88
  this.options.unshift({
89
+ option: '-u, --webUrl [webUrl]'
90
+ }, {
88
91
  option: '-i, --id [id]'
89
92
  }, {
90
93
  option: '-n, --name [name]'
@@ -95,6 +98,12 @@ _SpoTermSetGetCommand_instances = new WeakSet(), _SpoTermSetGetCommand_initTelem
95
98
  });
96
99
  }, _SpoTermSetGetCommand_initValidators = function _SpoTermSetGetCommand_initValidators() {
97
100
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
101
+ if (args.options.webUrl) {
102
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
103
+ if (isValidSharePointUrl !== true) {
104
+ return isValidSharePointUrl;
105
+ }
106
+ }
98
107
  if (args.options.id) {
99
108
  if (!validation_1.validation.isValidGuid(args.options.id)) {
100
109
  return `${args.options.id} is not a valid GUID`;
@@ -202,6 +202,7 @@ exports.default = {
202
202
  PAGE_SECTION_GET: `${prefix} page section get`,
203
203
  PAGE_SECTION_LIST: `${prefix} page section list`,
204
204
  PAGE_TEMPLATE_LIST: `${prefix} page template list`,
205
+ PAGE_TEMPLATE_REMOVE: `${prefix} page template remove`,
205
206
  PAGE_TEXT_ADD: `${prefix} page text add`,
206
207
  PROPERTYBAG_GET: `${prefix} propertybag get`,
207
208
  PROPERTYBAG_LIST: `${prefix} propertybag list`,
@@ -8,12 +8,6 @@ Gets information about the specified Microsoft 365 Group or Microsoft Teams team
8
8
  m365 aad o365group get [options]
9
9
  ```
10
10
 
11
- ## Alias
12
-
13
- ```sh
14
- m365 teams team get
15
- ```
16
-
17
11
  ## Options
18
12
 
19
13
  `-i, --id <id>`
@@ -37,9 +31,3 @@ Get information about the Microsoft 365 Group with id _1caf7dcd-7e83-4c3a-94f7-9
37
31
  ```sh
38
32
  m365 aad o365group get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --includeSiteUrl
39
33
  ```
40
-
41
- Get information about the Microsoft Teams team with id _2eaf7dcd-7e83-4c3a-94f7-932a1299c844_
42
-
43
- ```sh
44
- m365 teams team get --id 2eaf7dcd-7e83-4c3a-94f7-932a1299c844
45
- ```
@@ -0,0 +1,51 @@
1
+ # docs
2
+
3
+ Returns the CLI for Microsoft 365 docs webpage URL
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 docs [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Remarks
16
+
17
+ Configure `autoOpenLinksInBrowser` using [cli config set](../cmd/cli/config/config-set.md) to automatically open the webpage in the default browser.
18
+
19
+ ## Examples
20
+
21
+ Returns the CLI for Microsoft 365 docs webpage URL
22
+
23
+ ```sh
24
+ m365 docs
25
+ ```
26
+
27
+ ## Response
28
+
29
+ === "JSON"
30
+
31
+ ```json
32
+ "https://pnp.github.io/cli-microsoft365/"
33
+ ```
34
+
35
+ === "Text"
36
+
37
+ ```text
38
+ https://pnp.github.io/cli-microsoft365/
39
+ ```
40
+
41
+ === "CSV"
42
+
43
+ ```csv
44
+ https://pnp.github.io/cli-microsoft365/
45
+ ```
46
+
47
+ === "Markdown"
48
+
49
+ ```md
50
+ https://pnp.github.io/cli-microsoft365/
51
+ ```
@@ -0,0 +1,47 @@
1
+ # pa app consent set
2
+
3
+ Configures if users can bypass the API Consent window for the selected canvas app
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 pa app consent set [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-e, --environment <environment>`
14
+ : The name of the environment.
15
+
16
+ `-n, --name <name>`
17
+ : The name of the Power App to update
18
+
19
+ `-b, --bypass <bypass>`
20
+ : Set to `true` to allow users to bypass the API Consent window. Set to `false` to disable the bypass.
21
+
22
+ `--confirm`
23
+ : Don't prompt for confirmation
24
+
25
+ --8<-- "docs/cmd/_global.md"
26
+
27
+ ## Remarks
28
+
29
+ This command only works for canvas apps.
30
+
31
+ ## Examples
32
+
33
+ Enables the bypass for the specified canvas app
34
+
35
+ ```sh
36
+ m365 pa app consent set --environment 4be50206-9576-4237-8b17-38d8aadfaa36 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --bypass true
37
+ ```
38
+
39
+ Disables the bypass consent for the specified canvas app
40
+
41
+ ```sh
42
+ m365 pa app consent set --environment 4be50206-9576-4237-8b17-38d8aadfaa36 --name 3989cb59-ce1a-4a5c-bb78-257c5c39381d --bypass false --confirm
43
+ ```
44
+
45
+ ## Response
46
+
47
+ The command won't return a response on success.
@@ -8,12 +8,6 @@ Retrieve the specified planner task
8
8
  m365 planner task get [options]
9
9
  ```
10
10
 
11
- ## Alias
12
-
13
- ```sh
14
- m365 planner task details get [options]
15
- ```
16
-
17
11
  ## Options
18
12
 
19
13
  `-i, --id [id]`
@@ -0,0 +1,118 @@
1
+ # purview sensitivitylabel get
2
+
3
+ Retrieve the specified sensitivity label
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 purview sensitivitylabel get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id <id>`
14
+ : The Id of the sensitivity label.
15
+
16
+ `--userId [userId]`
17
+ : User's Azure AD ID. Optionally specify this if you want to get a list of sensitivity labels that the user has access to. Specify either `userId` or `userName` but not both.
18
+
19
+ `--userName [userName]`
20
+ : 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` or `userName` but not both.
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ !!! attention
27
+ 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.
28
+
29
+ !!! attention
30
+ 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.
31
+
32
+
33
+ ## Examples
34
+
35
+ Get a sensitivity label
36
+
37
+ ```sh
38
+ m365 purview sensitivitylabel get --id 6f4fb2db-ecf4-4279-94ba-23d059bf157e
39
+ ```
40
+
41
+ Get a sensitivity label that a specific user has access to by its Id
42
+
43
+ ```sh
44
+ m365 purview sensitivitylabel get --id 6f4fb2db-ecf4-4279-94ba-23d059bf157e --userId 59f80e08-24b1-41f8-8586-16765fd830d3
45
+ ```
46
+
47
+ Get a sensitivity label that a specific user has access to by its UPN
48
+
49
+ ```sh
50
+ m365 purview sensitivitylabel get --id 6f4fb2db-ecf4-4279-94ba-23d059bf157e --userName john.doe@contoso.com
51
+ ```
52
+
53
+ ## Response
54
+
55
+ === "JSON"
56
+
57
+ ```json
58
+ {
59
+ "id": "6f4fb2db-ecf4-4279-94ba-23d059bf157e",
60
+ "name": "Unrestricted",
61
+ "description": "",
62
+ "color": "",
63
+ "sensitivity": 0,
64
+ "tooltip": "Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.",
65
+ "isActive": true,
66
+ "isAppliable": true,
67
+ "contentFormats": [
68
+ "file",
69
+ "email"
70
+ ],
71
+ "hasProtection": false
72
+ }
73
+ ```
74
+
75
+ === "Text"
76
+
77
+ ```text
78
+ color :
79
+ contentFormats: ["file","email"]
80
+ description :
81
+ hasProtection : false
82
+ id : 6f4fb2db-ecf4-4279-94ba-23d059bf157e
83
+ isActive : true
84
+ isAppliable : true
85
+ name : Unrestricted
86
+ sensitivity : 0
87
+ tooltip : Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.
88
+ ```
89
+
90
+ === "CSV"
91
+
92
+ ```csv
93
+ id,name,description,color,sensitivity,tooltip,isActive,isAppliable,contentFormats,hasProtection
94
+ 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""]",
95
+ ```
96
+
97
+ === "Markdown"
98
+
99
+ ```md
100
+ # purview sensitivitylabel get --id "6f4fb2db-ecf4-4279-94ba-23d059bf157e"
101
+
102
+ Date: 3/25/2023
103
+
104
+ ## Unrestricted (6f4fb2db-ecf4-4279-94ba-23d059bf157e)
105
+
106
+ Property | Value
107
+ ---------|-------
108
+ id | 6f4fb2db-ecf4-4279-94ba-23d059bf157e
109
+ name | Unrestricted
110
+ description |
111
+ color |
112
+ sensitivity | 0
113
+ tooltip | Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.
114
+ isActive | true
115
+ isAppliable | true
116
+ contentFormats | ["file","email"]
117
+ hasProtection | false
118
+ ```
@@ -0,0 +1,111 @@
1
+ # purview sensitivitylabel list
2
+
3
+ Get a list of sensitivity labels
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 purview sensitivitylabel list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--userId [userId]`
14
+ : User's Azure AD ID. Optionally specify this if you want to get a list of sensitivity labels that the user has access to. Specify either `userId` or `userName` but not both.
15
+
16
+ `--userName [userName]`
17
+ : 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` or `userName` but not both.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Remarks
22
+
23
+ !!! attention
24
+ 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.
25
+
26
+ !!! attention
27
+ When operating in app-only mode, you have the option to use either the `userName` or `userId` parameters to retrieve the sensitivity label for a specific user. Without specifying either of these parameters, the command will retrieve the sensitivity label for the currently authenticated user when operating in delegated mode.
28
+
29
+ ## Examples
30
+
31
+ Get a list of sensitivity labels
32
+
33
+ ```sh
34
+ m365 purview sensitivitylabel list
35
+ ```
36
+
37
+ Get a list of sensitivity labels that a specific user has access to by its Id
38
+
39
+ ```sh
40
+ m365 purview sensitivitylabel list --userId 59f80e08-24b1-41f8-8586-16765fd830d3
41
+ ```
42
+
43
+ Get a list of sensitivity labels that a specific user has access to by its UPN
44
+
45
+ ```sh
46
+ m365 purview sensitivitylabel list --userName john.doe@contoso.com
47
+ ```
48
+
49
+ ## Response
50
+
51
+ === "JSON"
52
+
53
+ ```json
54
+ [
55
+ {
56
+ "id": "6f4fb2db-ecf4-4279-94ba-23d059bf157e",
57
+ "name": "Unrestricted",
58
+ "description": "",
59
+ "color": "",
60
+ "sensitivity": 0,
61
+ "tooltip": "Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.",
62
+ "isActive": true,
63
+ "isAppliable": true,
64
+ "contentFormats": [
65
+ "file",
66
+ "email"
67
+ ],
68
+ "hasProtection": false,
69
+ "parent": null
70
+ }
71
+ ]
72
+ ```
73
+
74
+ === "Text"
75
+
76
+ ```text
77
+ id name isActive
78
+ ------------------------------------ --------------------- --------
79
+ 6f4fb2db-ecf4-4279-94ba-23d059bf157e Unrestricted true
80
+ ```
81
+
82
+ === "CSV"
83
+
84
+ ```csv
85
+ id,name,isActive
86
+ 6f4fb2db-ecf4-4279-94ba-23d059bf157e,Unrestricted,1
87
+ ```
88
+
89
+ === "Markdown"
90
+
91
+ ```md
92
+ # purview sensitivitylabel list
93
+
94
+ Date: 3/26/2023
95
+
96
+ ## Unrestricted (6f4fb2db-ecf4-4279-94ba-23d059bf157e)
97
+
98
+ Property | Value
99
+ ---------|-------
100
+ id | 6f4fb2db-ecf4-4279-94ba-23d059bf157e
101
+ name | Unrestricted
102
+ description |
103
+ color |
104
+ sensitivity | 0
105
+ tooltip | Information either intended for general distribution, or which would not have any impact on the organization if it were to be distributed.
106
+ isActive | true
107
+ isAppliable | true
108
+ contentFormats | ["file","email"]
109
+ hasProtection | false
110
+ parent | null
111
+ ```