@pnp/cli-microsoft365 6.3.0-beta.861847a → 6.3.0-beta.98b4bc2

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 (73) hide show
  1. package/dist/cli/Cli.js +38 -0
  2. package/dist/m365/aad/commands/user/user-add.js +223 -0
  3. package/dist/m365/aad/commands/user/user-license-list.js +99 -0
  4. package/dist/m365/aad/commands/user/user-recyclebinitem-clear.js +103 -0
  5. package/dist/m365/aad/commands/user/user-recyclebinitem-list.js +41 -0
  6. package/dist/m365/aad/commands/user/user-recyclebinitem-remove.js +92 -0
  7. package/dist/m365/aad/commands/user/user-remove.js +107 -0
  8. package/dist/m365/aad/commands.js +6 -0
  9. package/dist/m365/context/commands/option/option-list.js +54 -0
  10. package/dist/m365/context/commands.js +1 -0
  11. package/dist/m365/flow/commands/environment/FlowEnvironmentDetails.js +3 -0
  12. package/dist/m365/flow/commands/environment/environment-get.js +26 -11
  13. package/dist/m365/pa/commands/environment/environment-get.js +13 -5
  14. package/dist/m365/planner/commands/plan/plan-get.js +17 -10
  15. package/dist/m365/planner/commands/plan/plan-remove.js +1 -1
  16. package/dist/m365/planner/commands/plan/plan-set.js +21 -10
  17. package/dist/m365/planner/commands/roster/roster-get.js +61 -0
  18. package/dist/m365/planner/commands/roster/roster-member-remove.js +140 -0
  19. package/dist/m365/planner/commands.js +2 -0
  20. package/dist/m365/pp/commands/environment/environment-get.js +18 -9
  21. package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +3 -4
  22. package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +3 -4
  23. package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +97 -0
  24. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +5 -0
  25. package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +3 -4
  26. package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +5 -0
  27. package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +5 -0
  28. package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +5 -0
  29. package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +5 -0
  30. package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +11 -1
  31. package/dist/m365/purview/commands.js +1 -0
  32. package/dist/m365/spo/commands/customaction/customaction-get.js +17 -66
  33. package/dist/m365/spo/commands/customaction/customaction-list.js +2 -36
  34. package/dist/m365/spo/commands/customaction/customaction-remove.js +11 -18
  35. package/dist/m365/spo/commands/navigation/navigation-node-get.js +73 -0
  36. package/dist/m365/spo/commands.js +1 -0
  37. package/dist/utils/aadUser.js +38 -0
  38. package/dist/utils/planner.js +1 -4
  39. package/dist/utils/spo.js +61 -0
  40. package/docs/docs/cmd/aad/user/user-add.md +168 -0
  41. package/docs/docs/cmd/aad/user/user-license-list.md +98 -0
  42. package/docs/docs/cmd/aad/user/user-recyclebinitem-clear.md +42 -0
  43. package/docs/docs/cmd/aad/user/user-recyclebinitem-list.md +82 -0
  44. package/docs/docs/cmd/aad/user/user-recyclebinitem-remove.md +45 -0
  45. package/docs/docs/cmd/aad/user/user-remove.md +51 -0
  46. package/docs/docs/cmd/context/option/option-list.md +63 -0
  47. package/docs/docs/cmd/flow/environment/environment-get.md +31 -3
  48. package/docs/docs/cmd/login.md +26 -0
  49. package/docs/docs/cmd/logout.md +4 -0
  50. package/docs/docs/cmd/pa/environment/environment-get.md +8 -2
  51. package/docs/docs/cmd/planner/plan/plan-get.md +12 -12
  52. package/docs/docs/cmd/planner/plan/plan-set.md +10 -4
  53. package/docs/docs/cmd/planner/roster/roster-get.md +73 -0
  54. package/docs/docs/cmd/planner/roster/roster-member-remove.md +51 -0
  55. package/docs/docs/cmd/purview/retentionevent/retentionevent-list.md +1 -1
  56. package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.md +45 -0
  57. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.md +3 -0
  58. package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.md +1 -1
  59. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +3 -0
  60. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.md +3 -0
  61. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.md +3 -0
  62. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.md +3 -0
  63. package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.md +3 -0
  64. package/docs/docs/cmd/request.md +74 -0
  65. package/docs/docs/cmd/spo/list/list-contenttype-add.md +1 -1
  66. package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +1 -1
  67. package/docs/docs/cmd/spo/list/list-contenttype-list.md +1 -1
  68. package/docs/docs/cmd/spo/list/list-contenttype-remove.md +1 -1
  69. package/docs/docs/cmd/spo/navigation/navigation-node-get.md +91 -0
  70. package/docs/docs/cmd/status.md +46 -0
  71. package/docs/docs/cmd/version.md +26 -0
  72. package/npm-shrinkwrap.json +911 -876
  73. package/package.json +12 -12
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
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 _SpoNavigationNodeGetCommand_instances, _SpoNavigationNodeGetCommand_initOptions, _SpoNavigationNodeGetCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const request_1 = require("../../../../request");
19
+ const validation_1 = require("../../../../utils/validation");
20
+ const SpoCommand_1 = require("../../../base/SpoCommand");
21
+ const commands_1 = require("../../commands");
22
+ class SpoNavigationNodeGetCommand extends SpoCommand_1.default {
23
+ get name() {
24
+ return commands_1.default.NAVIGATION_NODE_GET;
25
+ }
26
+ get description() {
27
+ return 'Retrieve information about a specific navigation node';
28
+ }
29
+ constructor() {
30
+ super();
31
+ _SpoNavigationNodeGetCommand_instances.add(this);
32
+ __classPrivateFieldGet(this, _SpoNavigationNodeGetCommand_instances, "m", _SpoNavigationNodeGetCommand_initOptions).call(this);
33
+ __classPrivateFieldGet(this, _SpoNavigationNodeGetCommand_instances, "m", _SpoNavigationNodeGetCommand_initValidators).call(this);
34
+ }
35
+ commandAction(logger, args) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (this.verbose) {
38
+ logger.logToStderr(`Retrieving information about navigation node with id ${args.options.id}`);
39
+ }
40
+ const requestOptions = {
41
+ url: `${args.options.webUrl}/_api/web/navigation/GetNodeById(${args.options.id})`,
42
+ headers: {
43
+ 'accept': 'application/json;odata=nometadata'
44
+ },
45
+ responseType: 'json'
46
+ };
47
+ try {
48
+ const listInstance = yield request_1.default.get(requestOptions);
49
+ logger.log(listInstance);
50
+ }
51
+ catch (err) {
52
+ this.handleRejectedODataJsonPromise(err);
53
+ }
54
+ });
55
+ }
56
+ }
57
+ _SpoNavigationNodeGetCommand_instances = new WeakSet(), _SpoNavigationNodeGetCommand_initOptions = function _SpoNavigationNodeGetCommand_initOptions() {
58
+ this.options.unshift({
59
+ option: '-u, --webUrl <webUrl>'
60
+ }, {
61
+ option: '--id <id>'
62
+ });
63
+ }, _SpoNavigationNodeGetCommand_initValidators = function _SpoNavigationNodeGetCommand_initValidators() {
64
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
65
+ const id = parseInt(args.options.id);
66
+ if (isNaN(id)) {
67
+ return `${args.options.id} is not a valid number`;
68
+ }
69
+ return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
70
+ }));
71
+ };
72
+ module.exports = new SpoNavigationNodeGetCommand();
73
+ //# sourceMappingURL=navigation-node-get.js.map
@@ -168,6 +168,7 @@ exports.default = {
168
168
  LISTITEM_SET: `${prefix} listitem set`,
169
169
  MAIL_SEND: `${prefix} mail send`,
170
170
  NAVIGATION_NODE_ADD: `${prefix} navigation node add`,
171
+ NAVIGATION_NODE_GET: `${prefix} navigation node get`,
171
172
  NAVIGATION_NODE_LIST: `${prefix} navigation node list`,
172
173
  NAVIGATION_NODE_REMOVE: `${prefix} navigation node remove`,
173
174
  NAVIGATION_NODE_SET: `${prefix} navigation node set`,
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.aadUser = void 0;
13
+ const request_1 = require("../request");
14
+ const formatting_1 = require("./formatting");
15
+ const graphResource = 'https://graph.microsoft.com';
16
+ exports.aadUser = {
17
+ /**
18
+ * Retrieve the id of a user by its UPN.
19
+ * @param upn User UPN.
20
+ */
21
+ getUserIdByUpn(upn) {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ const requestOptions = {
24
+ url: `${graphResource}/v1.0/users?$filter=userPrincipalName eq '${formatting_1.formatting.encodeQueryParameter(upn)}'&$select=Id`,
25
+ headers: {
26
+ accept: 'application/json;odata.metadata=none'
27
+ },
28
+ responseType: 'json'
29
+ };
30
+ const res = yield request_1.default.get(requestOptions);
31
+ if (res.value.length === 0) {
32
+ throw Error(`The specified user with user name ${upn} does not exist.`);
33
+ }
34
+ return res.value[0].id;
35
+ });
36
+ }
37
+ };
38
+ //# sourceMappingURL=aadUser.js.map
@@ -57,15 +57,12 @@ exports.planner = {
57
57
  * @param groupId Owner group ID.
58
58
  * @param rosterId Roster ID.
59
59
  */
60
- getPlanByTitle(title, groupId, rosterId, metadata = 'none') {
60
+ getPlanByTitle(title, groupId, metadata = 'none') {
61
61
  return __awaiter(this, void 0, void 0, function* () {
62
62
  let plans = [];
63
63
  if (groupId) {
64
64
  plans = yield this.getPlansByGroupId(groupId, metadata);
65
65
  }
66
- else if (rosterId) {
67
- plans = yield this.getPlansByRosterId(rosterId, metadata);
68
- }
69
66
  const filteredPlans = plans.filter(p => p.title && p.title.toLowerCase() === title.toLowerCase());
70
67
  if (!filteredPlans.length) {
71
68
  throw Error(`The specified plan '${title}' does not exist.`);
package/dist/utils/spo.js CHANGED
@@ -18,6 +18,7 @@ const config_1 = require("../config");
18
18
  const base_permissions_1 = require("../m365/spo/base-permissions");
19
19
  const request_1 = require("../request");
20
20
  const formatting_1 = require("./formatting");
21
+ const odata_1 = require("./odata");
21
22
  exports.spo = {
22
23
  getRequestDigest(siteUrl) {
23
24
  const requestOptions = {
@@ -484,6 +485,66 @@ exports.spo = {
484
485
  const res = yield request_1.default.get(requestOptions);
485
486
  return res;
486
487
  });
488
+ },
489
+ /**
490
+ * Retrieves a list of Custom Actions from a SharePoint site.
491
+ * @param webUrl Web url
492
+ * @param scope The scope of custom actions to retrieve, allowed values "Site", "Web" or "All".
493
+ * @param filter An OData filter query to limit the results.
494
+ */
495
+ getCustomActions(webUrl, scope, filter) {
496
+ return __awaiter(this, void 0, void 0, function* () {
497
+ if (scope && scope !== "All" && scope !== "Site" && scope !== "Web") {
498
+ throw `Invalid scope '${scope}'. Allowed values are 'Site', 'Web' or 'All'.`;
499
+ }
500
+ const queryString = filter ? `?$filter=${filter}` : "";
501
+ if (scope && scope !== "All") {
502
+ return yield odata_1.odata.getAllItems(`${webUrl}/_api/${scope}/UserCustomActions${queryString}`);
503
+ }
504
+ const customActions = [
505
+ ...yield odata_1.odata.getAllItems(`${webUrl}/_api/Site/UserCustomActions${queryString}`),
506
+ ...yield odata_1.odata.getAllItems(`${webUrl}/_api/Web/UserCustomActions${queryString}`)
507
+ ];
508
+ return customActions;
509
+ });
510
+ },
511
+ /**
512
+ * Retrieves a Custom Actions from a SharePoint site by Id.
513
+ * @param webUrl Web url
514
+ * @param id The Id of the Custom Action
515
+ * @param scope The scope of custom actions to retrieve, allowed values "Site", "Web" or "All".
516
+ */
517
+ getCustomActionById(webUrl, id, scope) {
518
+ return __awaiter(this, void 0, void 0, function* () {
519
+ if (scope && scope !== "All" && scope !== "Site" && scope !== "Web") {
520
+ throw `Invalid scope '${scope}'. Allowed values are 'Site', 'Web' or 'All'.`;
521
+ }
522
+ function getById(webUrl, id, scope) {
523
+ return __awaiter(this, void 0, void 0, function* () {
524
+ const requestOptions = {
525
+ url: `${webUrl}/_api/${scope}/UserCustomActions(guid'${id}')`,
526
+ headers: {
527
+ accept: 'application/json;odata=nometadata'
528
+ },
529
+ responseType: 'json'
530
+ };
531
+ const result = yield request_1.default.get(requestOptions);
532
+ if (result["odata.null"] === true) {
533
+ return undefined;
534
+ }
535
+ return result;
536
+ });
537
+ }
538
+ if (scope && scope !== "All") {
539
+ return yield getById(webUrl, id, scope);
540
+ }
541
+ const customActionOnWeb = yield getById(webUrl, id, "Web");
542
+ if (customActionOnWeb) {
543
+ return customActionOnWeb;
544
+ }
545
+ const customActionOnSite = yield getById(webUrl, id, "Site");
546
+ return customActionOnSite;
547
+ });
487
548
  }
488
549
  };
489
550
  //# sourceMappingURL=spo.js.map
@@ -0,0 +1,168 @@
1
+ # aad user add
2
+
3
+ Creates a new user
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user add [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--displayName <displayName>`
14
+ : The name to display in the address book for the user.
15
+
16
+ `--userName <userName>`
17
+ : The user principal name (someuser@contoso.com).
18
+
19
+ `--accountEnabled [accountEnabled]`
20
+ : Whether the account is enabled. Possible values: `true`, `false`. Default value is `true`.
21
+
22
+ `--mailNickname [mailNickname]`
23
+ : The mail alias for the user. By default this value will be extracted from `userName`.
24
+
25
+ `--password [password]`
26
+ : The password for the user. When not specified, a password will be generated.
27
+
28
+ `--firstName [firstName]`
29
+ : The given name (first name) of the user. Maximum length is 64 characters.
30
+
31
+ `--lastName [lastName]`
32
+ : The user's surname (family name or last name). Maximum length is 64 characters.
33
+
34
+ `--forceChangePasswordNextSignIn`
35
+ : Whether the user should change his/her password on the next login.
36
+
37
+ `--forceChangePasswordNextSignInWithMfa`
38
+ : Whether the user should change his/her password on the next login and setup MFA.
39
+
40
+ `--usageLocation [usageLocation]`
41
+ : A two letter [country code](https://learn.microsoft.com/en-us/partner-center/commercial-marketplace-co-sell-location-codes#country-and-region-codes) (ISO standard 3166). Required for users that will be assigned licenses.
42
+
43
+ `--officeLocation [officeLocation]`
44
+ : The office location in the user's place of business.
45
+
46
+ `--jobTitle [jobTitle]`
47
+ : The user's job title. Maximum length is 128 characters.
48
+
49
+ `--companyName [companyName]`
50
+ : The company name which the user is associated. The maximum length is 64 characters.
51
+
52
+ `--department [department]`
53
+ : The name for the department in which the user works. Maximum length is 64 characters.
54
+
55
+ `--preferredLanguage [preferredLanguage]`
56
+ : The preferred language for the user. Should follow [ISO 639-1 Code](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a). Example: `en-US`.
57
+
58
+ `--managerUserId [managerUserId]`
59
+ : User ID of the user's manager. Specify `managerUserId` or `managerUserName` but not both.
60
+
61
+ `--managerUserName [managerUserName]`
62
+ : User principal name of the manager. Specify `managerUserId` or `managerUserName` but not both.
63
+
64
+ --8<-- "docs/cmd/_global.md"
65
+
66
+ ## Remarks
67
+
68
+ !!! important
69
+ To use this command you must be a Global administrator, User administrator or Privileged Authentication administrator
70
+
71
+ !!! note
72
+ After running this command, it may take a minute before the user is effectively created in the tenant.
73
+
74
+ ## Examples
75
+
76
+ Create a user and let him/her update the password at first login
77
+
78
+ ```sh
79
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --forceChangePasswordNextSignIn
80
+ ```
81
+
82
+ Create a user with job information
83
+
84
+ ```sh
85
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation Vosselaar --forceChangePasswordNextSignIn
86
+ ```
87
+
88
+ Create a user with language information
89
+
90
+ ```sh
91
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --preferredLanguage "nl-BE" --usageLocation BE --forceChangePasswordNextSignIn
92
+ ```
93
+
94
+ Create a user with a manager
95
+
96
+ ```sh
97
+ m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --managerUserName "adele@contoso.com"
98
+ ```
99
+
100
+ ## Response
101
+
102
+ === "JSON"
103
+
104
+ ```json
105
+ {
106
+ "id": "990e2425-f595-43bc-85ed-b89a44093793",
107
+ "businessPhones": [],
108
+ "displayName": "John Doe",
109
+ "givenName": "John",
110
+ "jobTitle": "Sales Manager",
111
+ "mail": null,
112
+ "mobilePhone": null,
113
+ "officeLocation": "Vosselaar",
114
+ "preferredLanguage": "nl-BE",
115
+ "surname": "Doe",
116
+ "userPrincipalName": "john.doe@contoso.com",
117
+ "password": "SomePassw0rd"
118
+ }
119
+ ```
120
+
121
+ === "Text"
122
+
123
+ ```text
124
+ businessPhones : []
125
+ displayName : John Doe
126
+ givenName : John
127
+ id : 990e2425-f595-43bc-85ed-b89a44093793
128
+ jobTitle : Sales Manager
129
+ mail : null
130
+ mobilePhone : null
131
+ officeLocation : Vosselaar
132
+ password : SomePassw0rd
133
+ preferredLanguage: nl-BE
134
+ surname : Doe
135
+ userPrincipalName: john.doe@contoso.com
136
+ ```
137
+
138
+ === "CSV"
139
+
140
+ ```csv
141
+ id,businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,password
142
+ 990e2425-f595-43bc-85ed-b89a44093793,[],John Doe,John,Sales Manager,,,Vosselaar,nl-BE,Doe,john.doe@contoso.com,SomePassw0rd
143
+ ```
144
+
145
+ === "Markdown"
146
+
147
+ ```md
148
+ # aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --firstName "John" --lastName "Doe" --jobTitle "Sales Manager" --officeLocation "Vosselaar" --preferredLanguage "nl-BE"
149
+
150
+ Date: 16/02/2023
151
+
152
+ ## John Doe (990e2425-f595-43bc-85ed-b89a44093793)
153
+
154
+ Property | Value
155
+ ---------|-------
156
+ id | 990e2425-f595-43bc-85ed-b89a44093793
157
+ businessPhones | []
158
+ displayName | John Doe
159
+ givenName | John
160
+ jobTitle | Sales Manager
161
+ mail | null
162
+ mobilePhone | null
163
+ officeLocation | Vosselaar
164
+ preferredLanguage | nl-BE
165
+ surname | Doe
166
+ userPrincipalName | john.doe@contoso.com
167
+ password | SomePassw0rd
168
+ ```
@@ -0,0 +1,98 @@
1
+ # aad user license list
2
+
3
+ Lists the license details for a given user
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user license list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--userId [userId]`
14
+ : The ID of the user. Specify either `userId` or `userName` but not both.
15
+
16
+ `--userName [userName]`
17
+ : User principal name of the user. Specify either `userId` or `userName` but not both.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Remarks
22
+
23
+ !!! tip
24
+ If you don't specify any option, the command will list the license details of the current logged in user. This does not work when using application permissions.
25
+
26
+ ## Examples
27
+
28
+ List license details of the current logged in user.
29
+
30
+ ```sh
31
+ m365 aad user license list
32
+ ```
33
+
34
+ List license details of a specific user by its UPN.
35
+
36
+ ```sh
37
+ m365 aad user license list --userName john.doe@contoso.com
38
+ ```
39
+
40
+ List license details of a specific user by its ID.
41
+
42
+ ```sh
43
+ m365 aad user license list --userId 59f80e08-24b1-41f8-8586-16765fd830d3
44
+ ```
45
+
46
+ ## Response
47
+
48
+ === "JSON"
49
+
50
+ ```json
51
+ [
52
+ {
53
+ "id": "x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw",
54
+ "skuId": "c42b9cae-ea4f-4ab7-9717-81576235ccac",
55
+ "skuPartNumber": "DEVELOPERPACK_E5",
56
+ "servicePlans": [
57
+ {
58
+ "servicePlanId": "7547a3fe-08ee-4ccb-b430-5077c5041653",
59
+ "servicePlanName": "YAMMER_ENTERPRISE",
60
+ "provisioningStatus": "Success",
61
+ "appliesTo": "User"
62
+ }
63
+ ]
64
+ }
65
+ ]
66
+ ```
67
+
68
+ === "Text"
69
+
70
+ ```text
71
+ id : x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw
72
+ skuId : c42b9cae-ea4f-4ab7-9717-81576235ccac
73
+ skuPartNumber: DEVELOPERPACK_E5
74
+ ```
75
+
76
+ === "CSV"
77
+
78
+ ```csv
79
+ id,skuId,skuPartNumber
80
+ x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw,c42b9cae-ea4f-4ab7-9717-81576235ccac,DEVELOPERPACK_E5
81
+ ```
82
+
83
+ === "Markdown"
84
+
85
+ ```md
86
+ # aad user license list --userId "0c9c625f-faa9-4c3b-8cd8-d874b869f78c"
87
+
88
+ Date: 2/19/2023
89
+
90
+ ## x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw
91
+
92
+ Property | Value
93
+ ---------|-------
94
+ id | x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw
95
+ skuId | c42b9cae-ea4f-4ab7-9717-81576235ccac
96
+ skuPartNumber | DEVELOPERPACK\_E5
97
+ servicePlans | [{"servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653","servicePlanName":"YAMMER\_ENTERPRISE","provisioningStatus":"Success","appliesTo":"User"}]
98
+ ```
@@ -0,0 +1,42 @@
1
+ # aad user recyclebinitem clear
2
+
3
+ Removes all users from the tenant recycle bin
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user recyclebinitem clear [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--confirm`
14
+ : Don't prompt for confirmation.
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Remarks
19
+
20
+ !!! important
21
+ To use this command you must be a Global administrator, User administrator or Privileged Authentication administrator.
22
+
23
+ !!! note
24
+ After running this command, it may take a minute before all deleted users are effectively removed from the tenant.
25
+
26
+ ## Examples
27
+
28
+ Removes all users from the tenant recycle bin
29
+
30
+ ```sh
31
+ m365 aad user recyclebinitem clear
32
+ ```
33
+
34
+ Removes all users from the tenant recycle bin without confirmation prompt
35
+
36
+ ```sh
37
+ m365 aad user recyclebinitem clear --confirm
38
+ ```
39
+
40
+ ## Response
41
+
42
+ The command won't return a response on success.
@@ -0,0 +1,82 @@
1
+ # aad user recyclebinitem list
2
+
3
+ Lists users from the recycle bin in the current tenant
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user recyclebinitem list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ --8<-- "docs/cmd/_global.md"
14
+
15
+ ## Examples
16
+
17
+ List all removed users
18
+
19
+ ```sh
20
+ m365 aad user recyclebinitem list
21
+ ```
22
+
23
+ ## Response
24
+
25
+ === "JSON"
26
+
27
+ ```json
28
+ [
29
+ {
30
+ "businessPhones": [],
31
+ "displayName": "John Doe",
32
+ "givenName": "John Doe",
33
+ "jobTitle": "Developer",
34
+ "mail": "john@contoso.com",
35
+ "mobilePhone": "0476345130",
36
+ "officeLocation": "Washington",
37
+ "preferredLanguage": "nl-BE",
38
+ "surname": "John",
39
+ "userPrincipalName": "7e06b56615f340138bf879874d52e68ajohn@contoso.com",
40
+ "id": "7e06b566-15f3-4013-8bf8-79874d52e68a"
41
+ }
42
+ ]
43
+ ```
44
+
45
+ === "Text"
46
+
47
+ ```text
48
+ id displayName userPrincipalName
49
+ ------------------------------------ ----------- -----------------------------------------------
50
+ 7e06b566-15f3-4013-8bf8-79874d52e68a John Doe 7e06b56615f340138bf879874d52e68ajohn@contoso.com
51
+ ```
52
+
53
+ === "CSV"
54
+
55
+ ```csv
56
+ id,displayName,userPrincipalName
57
+ 7e06b566-15f3-4013-8bf8-79874d52e68a,John Doe,7e06b56615f340138bf879874d52e68ajohn@contoso.com
58
+ ```
59
+
60
+ === "Markdown"
61
+
62
+ ```md
63
+ # aad user recyclebinitem list
64
+
65
+ Date: 14/02/2023
66
+
67
+ ## John Doe (7e06b566-15f3-4013-8bf8-79874d52e68a)
68
+
69
+ Property | Value
70
+ ---------|-------
71
+ businessPhones | []
72
+ displayName | John Doe
73
+ givenName | John Doe
74
+ jobTitle | Developer
75
+ mail | john@contoso.com
76
+ mobilePhone | 0476345130
77
+ officeLocation | Washington
78
+ preferredLanguage | nl-BE
79
+ surname | John
80
+ userPrincipalName | 7e06b56615f340138bf879874d52e68ajohn@contoso.com
81
+ id | 7e06b566-15f3-4013-8bf8-79874d52e68a
82
+ ```
@@ -0,0 +1,45 @@
1
+ # aad user recyclebinitem remove
2
+
3
+ Removes a user from the recycle bin in the current tenant
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 aad user recyclebinitem remove [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--id <id>`
14
+ : ID of the deleted user.
15
+
16
+ `--confirm`
17
+ : Don't prompt for confirmation.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Remarks
22
+
23
+ !!! important
24
+ To use this command you must be a Global administrator, User administrator or Privileged Authentication administrator.
25
+
26
+ !!! note
27
+ After running this command, it may take a minute before the deleted user is effectively removed from the tenant.
28
+
29
+ ## Examples
30
+
31
+ Removes a specific user from the recycle bin
32
+
33
+ ```sh
34
+ m365 aad user recyclebinitem remove --id 59f80e08-24b1-41f8-8586-16765fd830d3
35
+ ```
36
+
37
+ Removes a specific user from the recycle bin without confirmation prompt
38
+
39
+ ```sh
40
+ m365 aad user recyclebinitem remove --id 59f80e08-24b1-41f8-8586-16765fd830d3 --confirm
41
+ ```
42
+
43
+ ## Response
44
+
45
+ The command won't return a response on success.