@pnp/cli-microsoft365 6.7.0-beta.54db310 → 6.7.0-beta.60f2469

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.
@@ -44,9 +44,6 @@ class AadUserSetCommand extends GraphCommand_1.default {
44
44
  commandAction(logger, args) {
45
45
  return __awaiter(this, void 0, void 0, function* () {
46
46
  try {
47
- if (this.verbose) {
48
- logger.logToStderr(`Updating user ${args.options.userPrincipalName || args.options.objectId}`);
49
- }
50
47
  if (args.options.currentPassword) {
51
48
  if (args.options.objectId && args.options.objectId !== accessToken_1.accessToken.getUserIdFromAccessToken(Auth_1.default.service.accessTokens[Auth_1.default.defaultResource].accessToken)) {
52
49
  throw `You can only change your own password. Please use --objectId @meId to reference to your own userId`;
@@ -55,11 +52,14 @@ class AadUserSetCommand extends GraphCommand_1.default {
55
52
  throw 'You can only change your own password. Please use --userPrincipalName @meUserName to reference to your own user principal name';
56
53
  }
57
54
  }
55
+ if (this.verbose) {
56
+ logger.logToStderr(`Updating user ${args.options.userPrincipalName || args.options.objectId}`);
57
+ }
58
58
  const requestUrl = `${this.resource}/v1.0/users/${formatting_1.formatting.encodeQueryParameter(args.options.objectId ? args.options.objectId : args.options.userPrincipalName)}`;
59
59
  const manifest = this.mapRequestBody(args.options);
60
- if (Object.keys(manifest).length > 0) {
60
+ if (Object.keys(manifest).some(k => manifest[k] !== undefined)) {
61
61
  if (this.verbose) {
62
- logger.logToStderr(`Setting the updated properties for the user ${args.options.userPrincipalName || args.options.objectId}`);
62
+ logger.logToStderr(`Setting the updated properties for user ${args.options.userPrincipalName || args.options.objectId}`);
63
63
  }
64
64
  const requestOptions = {
65
65
  url: requestUrl,
@@ -74,6 +74,19 @@ class AadUserSetCommand extends GraphCommand_1.default {
74
74
  if (args.options.currentPassword) {
75
75
  yield this.changePassword(requestUrl, args.options, logger);
76
76
  }
77
+ if (args.options.managerUserId || args.options.managerUserName) {
78
+ if (this.verbose) {
79
+ logger.logToStderr(`Updating the manager to ${args.options.managerUserId || args.options.managerUserName}`);
80
+ }
81
+ yield this.updateManager(args.options);
82
+ }
83
+ else if (args.options.removeManager) {
84
+ if (this.verbose) {
85
+ logger.logToStderr('Removing the manager');
86
+ }
87
+ const user = args.options.objectId || args.options.userPrincipalName;
88
+ yield this.removeManager(user);
89
+ }
77
90
  }
78
91
  catch (err) {
79
92
  this.handleRejectedODataJsonPromise(err);
@@ -81,35 +94,32 @@ class AadUserSetCommand extends GraphCommand_1.default {
81
94
  });
82
95
  }
83
96
  mapRequestBody(options) {
84
- const requestBody = {};
85
- const excludeOptions = [
86
- 'debug',
87
- 'verbose',
88
- 'output',
89
- 'objectId',
90
- 'i',
91
- 'userPrincipalName',
92
- 'n',
93
- 'resetPassword',
94
- 'accountEnabled',
95
- 'currentPassword',
96
- 'newPassword',
97
- 'forceChangePasswordNextSignIn'
98
- ];
99
- if (options.accountEnabled !== undefined) {
100
- requestBody['AccountEnabled'] = options.accountEnabled;
101
- }
102
- Object.keys(options).forEach(key => {
103
- if (excludeOptions.indexOf(key) === -1) {
104
- requestBody[key] = `${options[key]}`;
105
- }
106
- });
97
+ const requestBody = {
98
+ displayName: options.displayName,
99
+ givenName: options.firstName,
100
+ surname: options.lastName,
101
+ usageLocation: options.usageLocation,
102
+ officeLocation: options.officeLocation,
103
+ jobTitle: options.jobTitle,
104
+ companyName: options.companyName,
105
+ department: options.department,
106
+ preferredLanguage: options.preferredLanguage,
107
+ accountEnabled: options.accountEnabled
108
+ };
109
+ this.addUnknownOptionsToPayload(requestBody, options);
107
110
  if (options.resetPassword) {
108
111
  requestBody.passwordProfile = {
109
112
  forceChangePasswordNextSignIn: options.forceChangePasswordNextSignIn || false,
113
+ forceChangePasswordNextSignInWithMfa: options.forceChangePasswordNextSignInWithMfa || false,
110
114
  password: options.newPassword
111
115
  };
112
116
  }
117
+ // Replace every empty string with null
118
+ for (const key in requestBody) {
119
+ if (typeof requestBody[key] === 'string' && requestBody[key].trim() === '') {
120
+ requestBody[key] = null;
121
+ }
122
+ }
113
123
  return requestBody;
114
124
  }
115
125
  changePassword(requestUrl, options, logger) {
@@ -132,6 +142,31 @@ class AadUserSetCommand extends GraphCommand_1.default {
132
142
  yield request_1.default.post(requestOptions);
133
143
  });
134
144
  }
145
+ updateManager(options) {
146
+ return __awaiter(this, void 0, void 0, function* () {
147
+ const managerRequestOptions = {
148
+ url: `${this.resource}/v1.0/users/${options.objectId || options.userPrincipalName}/manager/$ref`,
149
+ headers: {
150
+ accept: 'application/json;odata.metadata=none'
151
+ },
152
+ data: {
153
+ '@odata.id': `${this.resource}/v1.0/users/${options.managerUserId || options.managerUserName}`
154
+ }
155
+ };
156
+ yield request_1.default.put(managerRequestOptions);
157
+ });
158
+ }
159
+ removeManager(userId) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ const managerRequestOptions = {
162
+ url: `${this.resource}/v1.0/users/${userId}/manager/$ref`,
163
+ headers: {
164
+ accept: 'application/json;odata.metadata=none'
165
+ }
166
+ };
167
+ yield request_1.default.delete(managerRequestOptions);
168
+ });
169
+ }
135
170
  }
136
171
  _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry = function _AadUserSetCommand_initTelemetry() {
137
172
  this.telemetry.push((args) => {
@@ -142,7 +177,20 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
142
177
  resetPassword: !!args.options.resetPassword,
143
178
  forceChangePasswordNextSignIn: !!args.options.forceChangePasswordNextSignIn,
144
179
  currentPassword: typeof args.options.currentPassword !== 'undefined',
145
- newPassword: typeof args.options.newPassword !== 'undefined'
180
+ newPassword: typeof args.options.newPassword !== 'undefined',
181
+ displayName: typeof args.options.displayName !== 'undefined',
182
+ firstName: typeof args.options.firstName !== 'undefined',
183
+ lastName: typeof args.options.lastName !== 'undefined',
184
+ forceChangePasswordNextSignInWithMfa: !!args.options.forceChangePasswordNextSignInWithMfa,
185
+ usageLocation: typeof args.options.usageLocation !== 'undefined',
186
+ officeLocation: typeof args.options.officeLocation !== 'undefined',
187
+ jobTitle: typeof args.options.jobTitle !== 'undefined',
188
+ companyName: typeof args.options.companyName !== 'undefined',
189
+ department: typeof args.options.department !== 'undefined',
190
+ preferredLanguage: typeof args.options.preferredLanguage !== 'undefined',
191
+ managerUserId: typeof args.options.managerUserId !== 'undefined',
192
+ managerUserName: typeof args.options.managerUserName !== 'undefined',
193
+ removeManager: typeof args.options.removeManager !== 'undefined'
146
194
  });
147
195
  });
148
196
  }, _AadUserSetCommand_initOptions = function _AadUserSetCommand_initOptions() {
@@ -161,6 +209,32 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
161
209
  option: '--currentPassword [currentPassword]'
162
210
  }, {
163
211
  option: '--newPassword [newPassword]'
212
+ }, {
213
+ option: '--displayName [displayName]'
214
+ }, {
215
+ option: '--firstName [firstName]'
216
+ }, {
217
+ option: '--lastName [lastName]'
218
+ }, {
219
+ option: '--forceChangePasswordNextSignInWithMfa'
220
+ }, {
221
+ option: '--usageLocation [usageLocation]'
222
+ }, {
223
+ option: '--officeLocation [officeLocation]'
224
+ }, {
225
+ option: '--jobTitle [jobTitle]'
226
+ }, {
227
+ option: '--companyName [companyName]'
228
+ }, {
229
+ option: '--department [department]'
230
+ }, {
231
+ option: '--preferredLanguage [preferredLanguage]'
232
+ }, {
233
+ option: '--managerUserId [managerUserId]'
234
+ }, {
235
+ option: '--managerUserName [managerUserName]'
236
+ }, {
237
+ option: '--removeManager'
164
238
  });
165
239
  }, _AadUserSetCommand_initTypes = function _AadUserSetCommand_initTypes() {
166
240
  this.types.boolean.push('accountEnabled');
@@ -182,10 +256,51 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
182
256
  if (args.options.resetPassword && !args.options.newPassword) {
183
257
  return `When resetting a user's password, specify the new password to set for the user, using the newPassword option`;
184
258
  }
259
+ if (args.options.firstName && args.options.firstName.length > 64) {
260
+ return `The max lenght for the firstName option is 64 characters`;
261
+ }
262
+ if (args.options.lastName && args.options.lastName.length > 64) {
263
+ return `The max lenght for the lastName option is 64 characters`;
264
+ }
265
+ if (args.options.forceChangePasswordNextSignIn && !args.options.resetPassword) {
266
+ return `The option forceChangePasswordNextSignIn can only be used in combination with the resetPassword option`;
267
+ }
268
+ if (args.options.forceChangePasswordNextSignInWithMfa && !args.options.resetPassword) {
269
+ return `The option forceChangePasswordNextSignInWithMfa can only be used in combination with the resetPassword option`;
270
+ }
271
+ if (args.options.usageLocation) {
272
+ const regex = new RegExp('^[a-zA-Z]{2}$');
273
+ if (!regex.test(args.options.usageLocation)) {
274
+ return `'${args.options.usageLocation}' is not a valid usageLocation.`;
275
+ }
276
+ }
277
+ if (args.options.jobTitle && args.options.jobTitle.length > 128) {
278
+ return `The max lenght for the jobTitle option is 128 characters`;
279
+ }
280
+ if (args.options.companyName && args.options.companyName.length > 64) {
281
+ return `The max lenght for the companyName option is 64 characters`;
282
+ }
283
+ if (args.options.department && args.options.department.length > 64) {
284
+ return `The max lenght for the department option is 64 characters`;
285
+ }
286
+ if (args.options.preferredLanguage && args.options.preferredLanguage.length < 2) {
287
+ return `'${args.options.preferredLanguage}' is not a valid preferredLanguage`;
288
+ }
289
+ if (args.options.managerUserName && !validation_1.validation.isValidUserPrincipalName(args.options.managerUserName)) {
290
+ return `'${args.options.managerUserName}' is not a valid user principal name`;
291
+ }
292
+ if (args.options.managerUserId && !validation_1.validation.isValidGuid(args.options.managerUserId)) {
293
+ return `'${args.options.managerUserId}' is not a valid GUID`;
294
+ }
185
295
  return true;
186
296
  }));
187
297
  }, _AadUserSetCommand_initOptionSets = function _AadUserSetCommand_initOptionSets() {
188
- this.optionSets.push({ options: ['objectId', 'userPrincipalName'] });
298
+ this.optionSets.push({
299
+ options: ['objectId', 'userPrincipalName']
300
+ }, {
301
+ options: ['managerUserId', 'managerUserName', 'removeManager'],
302
+ runsWhen: (args) => args.options.managerUserId || args.options.managerUserName || args.options.removeManager
303
+ });
189
304
  };
190
305
  module.exports = new AadUserSetCommand();
191
306
  //# sourceMappingURL=user-set.js.map
@@ -0,0 +1,115 @@
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 _SpoSiteRecycleBinItemClearCommand_instances, _SpoSiteRecycleBinItemClearCommand_initTelemetry, _SpoSiteRecycleBinItemClearCommand_initOptions, _SpoSiteRecycleBinItemClearCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Cli_1 = require("../../../../cli/Cli");
19
+ const request_1 = require("../../../../request");
20
+ const validation_1 = require("../../../../utils/validation");
21
+ const SpoCommand_1 = require("../../../base/SpoCommand");
22
+ const commands_1 = require("../../commands");
23
+ class SpoSiteRecycleBinItemClearCommand extends SpoCommand_1.default {
24
+ get name() {
25
+ return commands_1.default.SITE_RECYCLEBINITEM_CLEAR;
26
+ }
27
+ get description() {
28
+ return 'Permanently removes all items in a site recycle bin';
29
+ }
30
+ constructor() {
31
+ super();
32
+ _SpoSiteRecycleBinItemClearCommand_instances.add(this);
33
+ __classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initTelemetry).call(this);
34
+ __classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initOptions).call(this);
35
+ __classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initValidators).call(this);
36
+ }
37
+ commandAction(logger, args) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ if (args.options.confirm) {
40
+ yield this.clearRecycleBin(args, logger);
41
+ }
42
+ else {
43
+ const result = yield Cli_1.Cli.prompt({
44
+ type: 'confirm',
45
+ name: 'continue',
46
+ default: false,
47
+ message: `Are you sure you want to clear the recycle bin of site ${args.options.siteUrl}?`
48
+ });
49
+ if (result.continue) {
50
+ yield this.clearRecycleBin(args, logger);
51
+ }
52
+ }
53
+ });
54
+ }
55
+ clearRecycleBin(args, logger) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ try {
58
+ if (this.verbose) {
59
+ logger.logToStderr(`Permanently removing all items in recycle bin of site ${args.options.siteUrl}...`);
60
+ }
61
+ const requestOptions = {
62
+ headers: {
63
+ accept: 'application/json;odata=nometadata'
64
+ },
65
+ responseType: 'json'
66
+ };
67
+ if (args.options.secondary) {
68
+ if (this.verbose) {
69
+ logger.logToStderr('Removing all items from the second-stage recycle bin');
70
+ }
71
+ requestOptions.url = `${args.options.siteUrl}/_api/site/RecycleBin/DeleteAllSecondStageItems`;
72
+ }
73
+ else {
74
+ if (this.verbose) {
75
+ logger.logToStderr('Removing all items from the first-stage recycle bin');
76
+ }
77
+ requestOptions.url = `${args.options.siteUrl}/_api/web/RecycleBin/DeleteAll`;
78
+ }
79
+ const result = yield request_1.default.post(requestOptions);
80
+ if (result['odata.null'] !== true) {
81
+ throw result;
82
+ }
83
+ }
84
+ catch (err) {
85
+ this.handleRejectedODataJsonPromise(err);
86
+ }
87
+ });
88
+ }
89
+ }
90
+ _SpoSiteRecycleBinItemClearCommand_instances = new WeakSet(), _SpoSiteRecycleBinItemClearCommand_initTelemetry = function _SpoSiteRecycleBinItemClearCommand_initTelemetry() {
91
+ this.telemetry.push((args) => {
92
+ Object.assign(this.telemetryProperties, {
93
+ secondary: !!args.options.secondary,
94
+ confirm: !!args.options.confirm
95
+ });
96
+ });
97
+ }, _SpoSiteRecycleBinItemClearCommand_initOptions = function _SpoSiteRecycleBinItemClearCommand_initOptions() {
98
+ this.options.unshift({
99
+ option: '-u, --siteUrl <siteUrl>'
100
+ }, {
101
+ option: '--secondary'
102
+ }, {
103
+ option: '--confirm'
104
+ });
105
+ }, _SpoSiteRecycleBinItemClearCommand_initValidators = function _SpoSiteRecycleBinItemClearCommand_initValidators() {
106
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
107
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.siteUrl);
108
+ if (isValidSharePointUrl !== true) {
109
+ return isValidSharePointUrl;
110
+ }
111
+ return true;
112
+ }));
113
+ };
114
+ module.exports = new SpoSiteRecycleBinItemClearCommand();
115
+ //# sourceMappingURL=site-recyclebinitem-clear.js.map
@@ -247,6 +247,7 @@ exports.default = {
247
247
  SITE_HUBSITE_THEME_SYNC: `${prefix} site hubsite theme sync`,
248
248
  SITE_LIST: `${prefix} site list`,
249
249
  SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
250
+ SITE_RECYCLEBINITEM_CLEAR: `${prefix} site recyclebinitem clear`,
250
251
  SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
251
252
  SITE_RECYCLEBINITEM_RESTORE: `${prefix} site recyclebinitem restore`,
252
253
  SITE_REMOVE: `${prefix} site remove`,
@@ -25,17 +25,56 @@ m365 aad user set [options]
25
25
  `--forceChangePasswordNextSignIn`
26
26
  : If specified, the user will have to change his password the next time they log in. Can only be set in combination with `resetPassword`.
27
27
 
28
+ `--forceChangePasswordNextSignInWithMfa`
29
+ : Whether the user should change his/her password on the next login and setup MFA. Can only be set in combination with `resetPassword`.
30
+
28
31
  `--currentPassword [currentPassword]`
29
32
  : Current password of the user that is signed in. If this parameter is set, `newPassword` is mandatory. Can't be combined with `resetPassword`.
30
33
 
31
34
  `--newPassword [newPassword]`
32
35
  : New password to be set. Must be set when specifying either `resetPassword` or `currentPassword`.
33
36
 
37
+ `--displayName [displayName]`
38
+ : The name to display in the address book for the user.
39
+
40
+ `--firstName [firstName]`
41
+ : The given name (first name) of the user. Maximum length is 64 characters.
42
+
43
+ `--lastName [lastName]`
44
+ : The user's surname (family name or last name). Maximum length is 64 characters.
45
+
46
+ `--usageLocation [usageLocation]`
47
+ : 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.
48
+
49
+ `--officeLocation [officeLocation]`
50
+ : The office location in the user's place of business.
51
+
52
+ `--jobTitle [jobTitle]`
53
+ : The user's job title. Maximum length is 128 characters.
54
+
55
+ `--companyName [companyName]`
56
+ : The company name which the user is associated. The maximum length is 64 characters.
57
+
58
+ `--department [department]`
59
+ : The name for the department in which the user works. Maximum length is 64 characters.
60
+
61
+ `--preferredLanguage [preferredLanguage]`
62
+ : 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`.
63
+
64
+ `--managerUserId [managerUserId]`
65
+ : User ID of the user's manager. Specify `managerUserId`, `managerUserName` or `removeManager` but not both.
66
+
67
+ `--managerUserName [managerUserName]`
68
+ : User principal name of the manager. Specify `managerUserId`, `managerUserName` or `removeManager` but not both.
69
+
70
+ `--removeManager`
71
+ : Remove currently set manager. The user will have no manager when this flag is set. Specify `managerUserId`, `managerUserName` or `removeManager` but not both.
72
+
34
73
  --8<-- "docs/cmd/_global.md"
35
74
 
36
75
  ## Remarks
37
76
 
38
- You can update information of a user, either by specifying that user's id (`objectId`) or user name (`userPrincipalName`), but not both.
77
+ This command allows using unknown options.
39
78
 
40
79
  If the user with the specified id or user name doesn't exist, you will get a `Resource 'xyz' does not exist or one of its queried reference-property objects are not present.` error.
41
80
 
@@ -50,7 +89,7 @@ m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --Department I
50
89
  Update multiple properties of user with name _steve@contoso.onmicrosoft.com_
51
90
 
52
91
  ```sh
53
- m365 aad user set --userPrincipalName steve@contoso.onmicrosoft.com --Department "Sales & Marketing" --CompanyName Contoso
92
+ m365 aad user set --userPrincipalName steve@contoso.onmicrosoft.com --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation "New York"
54
93
  ```
55
94
 
56
95
  Enable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
@@ -65,12 +104,6 @@ Disable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
65
104
  m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled false
66
105
  ```
67
106
 
68
- Enable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
69
-
70
- ```sh
71
- m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled true
72
- ```
73
-
74
107
  Reset password of a given user by userPrincipalName and require the user to change the password on the next sign in
75
108
 
76
109
  ```sh
@@ -83,6 +116,18 @@ Change password of the currently logged in user
83
116
  m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --currentPassword SLBF5gnRtyYc --newPassword 6NLUId79Lc24
84
117
  ```
85
118
 
119
+ Updates a user with a manager
120
+
121
+ ```sh
122
+ m365 aad user set --displayName "John Doe" --userName "john.doe@contoso.com" --managerUserName "adele@contoso.com"
123
+ ```
124
+
125
+ Updates a user by removing its manager
126
+
127
+ ```sh
128
+ m365 aad user set --userName "john.doe@contoso.com" --removeManager
129
+ ```
130
+
86
131
  ## Response
87
132
 
88
133
  The command won't return a response on success.
@@ -0,0 +1,45 @@
1
+ # spo site recyclebinitem clear
2
+
3
+ Permanently removes all items in a site recycle bin
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo site recyclebinitem clear [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --siteUrl <siteUrl>`
14
+ : URL of the site where the recycle bin is located.
15
+
16
+ `--secondary`
17
+ : Remove all items from the second-stage recycle bin. When not specified, items from the first-stage recycle bin will be cleared.
18
+
19
+ `--confirm`
20
+ : Don't prompt for confirmation.
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ !!! warning
27
+ Items in the recycle bin will be permanently removed without the ability to restore them.
28
+
29
+ ## Examples
30
+
31
+ Clear all items from the first-stage recycle bin
32
+
33
+ ```sh
34
+ m365 spo site recyclebinitem clear --siteUrl https://contoso.sharepoint.com/sites/sales
35
+ ```
36
+
37
+ Clear all items from the second-stage recycle bin
38
+
39
+ ```sh
40
+ m365 spo site recyclebinitem clear --siteUrl https://contoso.sharepoint.com/sites/sales --secondary
41
+ ```
42
+
43
+ ## Response
44
+
45
+ The command won't return a response on success.
@@ -52,3 +52,9 @@ m365 tenant id get
52
52
  ```csv
53
53
  e65b162c-6f87-4eb1-a24e-1b37d3504663
54
54
  ```
55
+
56
+ === "Markdown"
57
+
58
+ ```md
59
+ e65b162c-6f87-4eb1-a24e-1b37d3504663
60
+ ```
@@ -72,3 +72,10 @@ m365 tenant report activeusercounts --period D7 --output json > "activeusercount
72
72
  Report Refresh Date,Office 365,Exchange,OneDrive,SharePoint,Skype For Business,Yammer,Teams,Report Date,Report Period
73
73
  2022-10-25,1,5,4,3,2,3,1,2022-10-19,7
74
74
  ```
75
+
76
+ === "Markdown"
77
+
78
+ ```md
79
+ Report Refresh Date,Office 365,Exchange,OneDrive,SharePoint,Skype For Business,Yammer,Teams,Report Date,Report Period
80
+ 2022-10-25,1,5,4,3,2,3,1,2022-10-19,7
81
+ ```
@@ -99,3 +99,10 @@ m365 tenant report activeuserdetail --period D7 --output json > "activeuserdetai
99
99
  Report Refresh Date,User Principal Name,Display Name,Is Deleted,Deleted Date,Has Exchange License,Has OneDrive License,Has SharePoint License,Has Skype For Business License,Has Yammer License,Has Teams License,Exchange Last Activity Date,OneDrive Last Activity Date,SharePoint Last Activity Date,Skype For Business Last Activity Date,Yammer Last Activity Date,Teams Last Activity Date,Exchange License Assign Date,OneDrive License Assign Date,SharePoint License Assign Date,Skype For Business License Assign Date,Yammer License Assign Date,Teams License Assign Date,Assigned Products
100
100
  2022-10-23,77E5979DD60BA6EAA53E814DBEEEFA5F,4291DA7C39EE3263E97336B42734A667,False,,True,True,True,True,True,True,,2022-09-12,2020-09-12,2022-09-12,2021-10-30,2020-10-30,2019-04-21,2017-09-20,2021-01-10,2021-01-10,2021-01-10,2021-01-10,2021-01-10,2021-01-10,MICROSOFT 365 E5 DEVELOPER (WITHOUT WINDOWS AND AUDIO CONFERENCING)
101
101
  ```
102
+
103
+ === "Markdown"
104
+
105
+ ```md
106
+ Report Refresh Date,User Principal Name,Display Name,Is Deleted,Deleted Date,Has Exchange License,Has OneDrive License,Has SharePoint License,Has Skype For Business License,Has Yammer License,Has Teams License,Exchange Last Activity Date,OneDrive Last Activity Date,SharePoint Last Activity Date,Skype For Business Last Activity Date,Yammer Last Activity Date,Teams Last Activity Date,Exchange License Assign Date,OneDrive License Assign Date,SharePoint License Assign Date,Skype For Business License Assign Date,Yammer License Assign Date,Teams License Assign Date,Assigned Products
107
+ 2022-10-23,77E5979DD60BA6EAA53E814DBEEEFA5F,4291DA7C39EE3263E97336B42734A667,False,,True,True,True,True,True,True,,2022-09-12,2020-09-12,2022-09-12,2021-10-30,2020-10-30,2019-04-21,2017-09-20,2021-01-10,2021-01-10,2021-01-10,2021-01-10,2021-01-10,2021-01-10,MICROSOFT 365 E5 DEVELOPER (WITHOUT WINDOWS AND AUDIO CONFERENCING)
108
+ ```
@@ -51,3 +51,10 @@ m365 tenant report office365activationcounts
51
51
  Report Refresh Date,Product Type,Windows,Mac,Android,iOS,Windows 10 Mobile
52
52
  2022-10-25,MICROSOFT 365 APPS FOR ENTERPRISE,5,0,0,0,0
53
53
  ```
54
+
55
+ === "Markdown"
56
+
57
+ ```md
58
+ Report Refresh Date,Product Type,Windows,Mac,Android,iOS,Windows 10 Mobile
59
+ 2022-10-25,MICROSOFT 365 APPS FOR ENTERPRISE,5,0,0,0,0
60
+ ```
@@ -49,3 +49,10 @@ m365 tenant report office365activationsusercounts
49
49
  Report Refresh Date,Product Type,Assigned,Activated,Shared Computer Activation
50
50
  2022-10-25,MICROSOFT 365 APPS FOR ENTERPRISE,24,5,0
51
51
  ```
52
+
53
+ === "Markdown"
54
+
55
+ ```md
56
+ Report Refresh Date,Product Type,Assigned,Activated,Shared Computer Activation
57
+ 2022-10-25,MICROSOFT 365 APPS FOR ENTERPRISE,24,5,0
58
+ ```
@@ -55,3 +55,10 @@ m365 tenant report office365activationsuserdetail
55
55
  Report Refresh Date,User Principal Name,Display Name,Product Type,Last Activated Date,Windows,Mac,Windows 10 Mobile,iOS,Android,Activated On Shared Computer
56
56
  2022-10-25,77E5979DD60BA6EAA53E814DBEEEFA5F,4291DA7C39EE3263E97336B42734A667,MICROSOFT 365 APPS FOR ENTERPRISE,2021-01-10,1,0,0,0,0,False
57
57
  ```
58
+
59
+ === "Markdown"
60
+
61
+ ```md
62
+ Report Refresh Date,User Principal Name,Display Name,Product Type,Last Activated Date,Windows,Mac,Windows 10 Mobile,iOS,Android,Activated On Shared Computer
63
+ 2022-10-25,77E5979DD60BA6EAA53E814DBEEEFA5F,4291DA7C39EE3263E97336B42734A667,MICROSOFT 365 APPS FOR ENTERPRISE,2021-01-10,1,0,0,0,0,False
64
+ ```
@@ -78,3 +78,10 @@ m365 tenant report servicesusercounts --period D7 --output json > "servicesuserc
78
78
  Report Refresh Date,Exchange Active,Exchange Inactive,OneDrive Active,OneDrive Inactive,SharePoint Active,SharePoint Inactive,Skype For Business Active,Skype For Business Inactive,Yammer Active,Yammer Inactive,Teams Active,Teams Inactive,Office 365 Active,Office 365 Inactive,Report Period
79
79
  2022-10-23,1,23,1,23,1,23,0,24,0,24,1,23,2,22,7
80
80
  ```
81
+
82
+ === "Markdown"
83
+
84
+ ```md
85
+ Report Refresh Date,Exchange Active,Exchange Inactive,OneDrive Active,OneDrive Inactive,SharePoint Active,SharePoint Inactive,Skype For Business Active,Skype For Business Inactive,Yammer Active,Yammer Inactive,Teams Active,Teams Inactive,Office 365 Active,Office 365 Inactive,Report Period
86
+ 2022-10-23,1,23,1,23,1,23,0,24,0,24,1,23,2,22,7
87
+ ```
@@ -133,3 +133,26 @@ m365 tenant security alerts list --vendor "Azure Sentinel"
133
133
  id,title,severity
134
134
  4ece2cf8-cbc0-5a42-92c3-e23f96006907,SharePoint Bulk Edit Items,medium
135
135
  ```
136
+
137
+ === "Markdown"
138
+
139
+ ```md
140
+ # tenant security alerts list
141
+
142
+ Date: 3/20/2022
143
+
144
+ ## Unfamiliar sign-in properties (2517536653831539999_658fa695-a5e6-4b60-ac7c-b2c1396df384)
145
+
146
+ Property | Value
147
+ ---------|-------
148
+ id | 2517536653831539999_658fa695-a5e6-4b60-ac7c-b2c1396df384
149
+ azureTenantId | b8e1599d-b418-4be9-8f39-df03c3abe27a
150
+ category | Storage.Blob_GeoAnomaly
151
+ createdDateTime | 2022-03-30T13:19:15.8039138Z
152
+ description | The following properties of this sign-in are unfamiliar for the given user: ASN, Browser, Device, IP, Location, EASId, TenantIPsubnet
153
+ eventDateTime | 2022-03-30T10:16:56.846Z
154
+ lastModifiedDateTime | 2022-03-30T13:19:48.5196488Z
155
+ severity | low
156
+ status | newAlert
157
+ title | Access from an unusual location to a storage blob container
158
+ ```
@@ -61,6 +61,22 @@ m365 tenant serviceannouncement health get --serviceName "Exchange Online" --iss
61
61
  Exchange,serviceDegradation,Exchange Online
62
62
  ```
63
63
 
64
+ === "Markdown"
65
+
66
+ ```md
67
+ # tenant serviceannouncement health get --serviceName "Exchange Online"
68
+
69
+ Date: 4/19/2023
70
+
71
+ ## Exchange
72
+
73
+ Property | Value
74
+ ---------|-------
75
+ service | Exchange Online
76
+ status | serviceDegradation
77
+ id | Exchange
78
+ ```
79
+
64
80
  ### `issues` response
65
81
 
66
82
  When we make use of the option `issues` the response will differ.
@@ -118,3 +134,19 @@ When we make use of the option `issues` the response will differ.
118
134
  id,status,service
119
135
  Exchange,serviceDegradation,Exchange Online
120
136
  ```
137
+
138
+ === "Markdown"
139
+
140
+ ```md
141
+ # tenant serviceannouncement health get --serviceName "Exchange Online" --issues "true"
142
+
143
+ Date: 4/19/2023
144
+
145
+ ## Exchange
146
+
147
+ Property | Value
148
+ ---------|-------
149
+ service | Exchange Online
150
+ status | serviceDegradation
151
+ id | Exchange
152
+ ```
@@ -60,6 +60,22 @@ m365 tenant serviceannouncement health list --issues
60
60
  Exchange,serviceDegradation,Exchange Online
61
61
  ```
62
62
 
63
+ === "Markdown"
64
+
65
+ ```md
66
+ # tenant serviceannouncement health list
67
+
68
+ Date: 4/19/2023
69
+
70
+ ## Exchange
71
+
72
+ Property | Value
73
+ ---------|-------
74
+ service | Exchange Online
75
+ status | serviceDegradation
76
+ id | Exchange
77
+ ```
78
+
63
79
  ### `issues` response
64
80
 
65
81
  When we make use of the option `issues` the response will differ.
@@ -119,3 +135,19 @@ When we make use of the option `issues` the response will differ.
119
135
  id,status,service
120
136
  Exchange,serviceDegradation,Exchange Online
121
137
  ```
138
+
139
+ === "Markdown"
140
+
141
+ ```md
142
+ # tenant serviceannouncement health list --issues "true"
143
+
144
+ Date: 4/19/2023
145
+
146
+ ## Exchange
147
+
148
+ Property | Value
149
+ ---------|-------
150
+ service | Exchange Online
151
+ status | serviceDegradation
152
+ id | Exchange
153
+ ```
@@ -84,3 +84,29 @@ m365 tenant serviceannouncement healthissue get --id MO226784
84
84
  startDateTime,endDateTime,lastModifiedDateTime,title,id,impactDescription,classification,origin,status,service,feature,featureGroup,isResolved,highImpact,details,posts
85
85
  2022-05-24T16:00:00Z,2022-05-24T22:20:00Z,2022-05-24T22:27:18.63Z,Installation delays within the Power Platform admin center,CR384241,Users may have experienced delays when installing applications within the Power Platform admin center.,advisory,microsoft,serviceRestored,Dynamics 365 Apps,Other,Other,1,,[],"[{""createdDateTime"":""2022-05-24T21:22:56.817Z"",""postType"":""regular"",""description"":{""contentType"":""html"",""content"":""Title: Installation delays within the Power Platform admin center\n\nUser Impact: Users may experience delays when installing applications within the Power Platform admin center.\n\nWe are aware of an emerging issue where users are experiencing delays when installing applications through the Power Platform admin center. We are investigating the issue and will provide another update within the next 30 minutes.\n\nThis information is preliminary and may be subject to changes, corrections, and updates.""}}]"
86
86
  ```
87
+
88
+ === "Markdown"
89
+
90
+ ```md
91
+ # tenant serviceannouncement healthissue get --id "MO226784"
92
+
93
+ Date: 5/24/2022
94
+
95
+ ## Installation delays within the Power Platform admin center (MO226784)
96
+
97
+ Property | Value
98
+ ---------|-------
99
+ startDateTime | 2022-05-24T16:00:00Z
100
+ endDateTime | 2022-05-24T22:20:00Z
101
+ lastModifiedDateTime | 2022-05-24T22:27:18.63Z
102
+ title | Installation delays within the Power Platform admin center
103
+ id | CR384241
104
+ impactDescription | Users may have experienced delays when installing applications within the Power Platform admin center.
105
+ classification | advisory
106
+ origin | microsoft
107
+ status | serviceRestored
108
+ service | Dynamics 365 Apps
109
+ feature | Other
110
+ featureGroup | Other
111
+ isResolved | true
112
+ ```
@@ -80,6 +80,32 @@ m365 tenant serviceannouncement healthissue list --service "Microsoft Forms"
80
80
  CR384241,Installation delays within the Power Platform admin center
81
81
  ```
82
82
 
83
+ === "Markdown"
84
+
85
+ ```md
86
+ # tenant serviceannouncement healthissue list
87
+
88
+ Date: 5/24/2022
89
+
90
+ ## Installation delays within the Power Platform admin center (CR384241)
91
+
92
+ Property | Value
93
+ ---------|-------
94
+ startDateTime | 2022-05-24T16:00:00Z
95
+ endDateTime | 2022-05-24T22:20:00Z
96
+ lastModifiedDateTime | 2022-05-24T22:27:18.63Z
97
+ title | Installation delays within the Power Platform admin center
98
+ id | CR384241
99
+ impactDescription | Users may have experienced delays when installing applications within the Power Platform admin center.
100
+ classification | advisory
101
+ origin | microsoft
102
+ status | serviceRestored
103
+ service | Dynamics 365 Apps
104
+ feature | Other
105
+ featureGroup | Other
106
+ isResolved | true
107
+ ```
108
+
83
109
  ## More information
84
110
 
85
111
  - List serviceAnnouncement issues: [https://docs.microsoft.com/en-us/graph/api/serviceannouncement-list-issues](https://docs.microsoft.com/en-us/graph/api/serviceannouncement-list-issues)
@@ -86,6 +86,28 @@ m365 tenant serviceannouncement message get --id MC001337
86
86
  2021-07-08T00:37:37Z,2022-12-09T07:00:00Z,2022-06-07T20:21:06.713Z,(Updated) Microsoft Lists: Custom list templates,MC267581,planForChange,normal,"[""Updated message"",""New feature"",""User impact"",""Admin impact""]",,,"[""SharePoint Online""]",,,,[],"{""contentType"":""html"",""content"":""<p>Updated June 7, 2022: We have updated the rollout timeline below. Thank you for your patience.</p><p>This new feature will support the addition of custom list templates from your organization alongside the ready-made templates Microsoft provides to make it easy to get started tracking and managing information.</p> \n<p>[Key points]</p> \n<ul> \n<li>Microsoft 365 <a href=\""https://www.microsoft.com/microsoft-365/roadmap?filters=&amp;searchterms=70753\"" target=\""_blank\"">Roadmap ID: 70753</a></li> \n<li>Timing:<ul><li>Targeted release (entire org): Complete</li><li>Standard release: will roll out in mid-September (previously mid-May) and be complete by early November (previously mid-June)</li></ul></li> \n<li>Roll-out: tenant level </li> \n<li>Control type: user control / admin control</li> \n<li>Action: review, assess and educate</li></ul><p>[How this will affect your organization]</p><p>This feature will give organizations the ability to create their own custom list templates with custom formatting and schema. It will also empower organizations to create repeatable solutions within the same Microsoft Lists infrastructure (including list creation in SharePoint, Teams, and within the Lists app itself).</p><p>End-user impact:</p>\n<p>Visual updates to the list creation dialog and the addition of a<i> From your organization</i> tab when creating a new list. This new tab is where your custom list templates appear alongside the ready-made templates from Microsoft.</p>\n<p><img src=\""https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE4P81n?ver=c93f\"" alt=\""Your custom list templates along with Microsoft ready-made templates\"" width=\""550\""><br>\nAdmin impact:</p>\n<p>Custom list templates can only be uploaded by a SharePoint administrator for Microsoft 365 by using PowerShell cmdlets. For consistency, the process of defining and uploading custom list templates is like the custom site templates experience.</p><p>To define and upload custom list templates, admins will use the following site template PowerShell cmdlets:</p><ul><li>Use the <a href=\""https://docs.microsoft.com/powershell/module/sharepoint-online/get-spositescriptfromlist?view=sharepoint-ps\"" target=\""_blank\"">Get-SPOSiteScriptFromList</a> cmdlet to extract the site script from any list</li><li>Run <a href=\""https://docs.microsoft.com/powershell/module/sharepoint-online/add-spositescript?view=sharepoint-ps\"" target=\""_blank\"">Add-SPOSiteScript</a> and <b style=\""\"">Add-SPOListDesign</b> to add the custom list template to your organization.</li><li>Scope who sees the template by using <a href=\""https://docs.microsoft.com/powershell/module/sharepoint-online/grant-spositedesignrights?view=sharepoint-ps\"" target=\""_blank\"">Grant-SPOSiteDesignRights</a> (Optional).</li></ul><p>The visual updates for this feature will be seen by end-users in the updated user interface (UI) when creating a list.</p><p>The <i>From your organization</i> tab will be empty until your organization defines and publishes custom list templates.</p>\n<p><img src=\""https://img-prod-cms-rt-microsoft-com.akamaized.net/cms/api/am/imageFileData/RE4P81t?ver=70be\"" alt=\""Your custom list templates along with Microsoft ready-made templates\"" width=\""550\""></p><p>[What you need to do to prepare]</p><p>You might want to notify your users about this new capability and update your training and documentation as appropriate.</p>\n<p>Learn more:</p><ul><li><a href=\""https://docs.microsoft.com/sharepoint/dev/declarative-customization/site-design-overview\"" target=\""_blank\"">PowerShell Cmdlets documentation for custom list templates</a></li><li> <a href=\""https://docs.microsoft.com/sharepoint/lists-custom-template\"" target=\""_blank\"">Creating custom list templates</a></li></ul>""}"
87
87
  ```
88
88
 
89
+ === "Markdown"
90
+
91
+ ```md
92
+ # tenant serviceannouncement message get --id "MC267581"
93
+
94
+ Date: 5/24/2022
95
+
96
+ ## (Updated) Microsoft Lists: Custom list templates (MC267581)
97
+
98
+ Property | Value
99
+ ---------|-------
100
+ startDateTime | 2021-07-08T00:37:37Z
101
+ endDateTime | 2022-12-09T07:00:00Z
102
+ lastModifiedDateTime | 2022-06-07T20:21:06.713Z
103
+ title | (Updated) Microsoft Lists: Custom list templates
104
+ id | MC267581
105
+ category | planForChange
106
+ severity | normal
107
+ isMajorChange | false
108
+ hasAttachments | false
109
+ ```
110
+
89
111
  ## More information
90
112
 
91
113
  - Microsoft Graph REST API reference: [https://docs.microsoft.com/en-us/graph/api/serviceupdatemessage-get](https://docs.microsoft.com/en-us/graph/api/serviceupdatemessage-get)
@@ -80,6 +80,28 @@ m365 tenant serviceannouncement message list --service "Microsoft Teams"
80
80
  id,title
81
81
  MC267581,(Updated) Microsoft Lists: Custom list templates
82
82
  ```
83
+
84
+ === "Markdown"
85
+
86
+ ```md
87
+ # tenant serviceannouncement message list
88
+
89
+ Date: 5/24/2022
90
+
91
+ ## (Updated) Microsoft Lists: Custom list templates (MC267581)
92
+
93
+ Property | Value
94
+ ---------|-------
95
+ startDateTime | 2021-07-08T00:37:37Z
96
+ endDateTime | 2022-12-09T07:00:00Z
97
+ lastModifiedDateTime | 2023-04-11T19:33:45.553Z
98
+ title | (Updated) Microsoft Lists: Custom list templates
99
+ id | MC267581
100
+ category | planForChange
101
+ severity | normal
102
+ isMajorChange | false
103
+ hasAttachments | false
104
+ ```
83
105
 
84
106
  ## More information
85
107
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.7.0-beta.54db310",
3
+ "version": "6.7.0-beta.60f2469",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",
@@ -207,6 +207,7 @@
207
207
  "Thangavel, Sekar <sekar.thangavel@gmail.com>",
208
208
  "Thorild, Fredrik <fredrik.thorild@sogeti.com>",
209
209
  "Trinder, Garry <garry.trinder@live.com>",
210
+ "Tripathi, Saurabh <saurabh.k.a.tripathi@avanade.com>",
210
211
  "Vaghasia, Siddharth <siddh.vaghasia@gmail.com>",
211
212
  "Van de Voorde, Tim <tim.vdv1995@hotmail.com>",
212
213
  "van Dijk, Mark <mark@ichicraft.com>",