@pnp/cli-microsoft365 8.0.0 → 8.1.0-beta.3a80e6f

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 (76) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +9 -9
  4. package/dist/Command.js +49 -2
  5. package/dist/cli/cli.js +60 -38
  6. package/dist/m365/commands/login.js +44 -96
  7. package/dist/m365/connection/commands/connection-remove.js +6 -2
  8. package/dist/m365/connection/commands/connection-set.js +4 -1
  9. package/dist/m365/connection/commands/connection-use.js +25 -4
  10. package/dist/m365/entra/commands/m365group/m365group-user-add.js +109 -32
  11. package/dist/m365/entra/commands/m365group/m365group-user-set.js +159 -84
  12. package/dist/m365/entra/commands/multitenant/multitenant-add.js +65 -0
  13. package/dist/m365/entra/commands/multitenant/multitenant-remove.js +118 -0
  14. package/dist/m365/entra/commands/multitenant/multitenant-set.js +72 -0
  15. package/dist/m365/entra/commands.js +3 -0
  16. package/dist/m365/flow/commands/flow-get.js +1 -1
  17. package/dist/m365/spe/ContainerTypeProperties.js +2 -0
  18. package/dist/m365/spe/commands/containertype/containertype-list.js +49 -0
  19. package/dist/m365/spe/commands.js +2 -1
  20. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +16 -21
  21. package/dist/m365/spo/commands/commandset/commandset-get.js +31 -17
  22. package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
  23. package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
  24. package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
  25. package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
  26. package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +86 -0
  27. package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +110 -0
  28. package/dist/m365/spo/commands/list/ListInstance.js +6 -1
  29. package/dist/m365/spo/commands/list/list-get.js +9 -3
  30. package/dist/m365/spo/commands/list/list-roleassignment-add.js +46 -21
  31. package/dist/m365/spo/commands/list/list-roleassignment-remove.js +48 -46
  32. package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +19 -5
  33. package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +20 -6
  34. package/dist/m365/spo/commands.js +2 -0
  35. package/dist/utils/drive.js +61 -0
  36. package/dist/utils/formatting.js +16 -0
  37. package/dist/utils/spo.js +69 -6
  38. package/dist/utils/zod.js +124 -0
  39. package/docs/docs/cmd/connection/connection-use.mdx +8 -2
  40. package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +28 -10
  41. package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +35 -11
  42. package/docs/docs/cmd/entra/multitenant/multitenant-add.mdx +107 -0
  43. package/docs/docs/cmd/entra/multitenant/multitenant-remove.mdx +58 -0
  44. package/docs/docs/cmd/entra/multitenant/multitenant-set.mdx +53 -0
  45. package/docs/docs/cmd/flow/flow-get.mdx +149 -283
  46. package/docs/docs/cmd/planner/plan/plan-remove.mdx +1 -1
  47. package/docs/docs/cmd/spe/containertype/containertype-list.mdx +102 -0
  48. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +87 -38
  49. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +22 -28
  50. package/docs/docs/cmd/spo/commandset/commandset-get.mdx +75 -24
  51. package/docs/docs/cmd/spo/commandset/commandset-list.mdx +26 -32
  52. package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
  53. package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +2 -2
  54. package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
  55. package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
  56. package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
  57. package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +2 -2
  58. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +110 -0
  59. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +114 -0
  60. package/docs/docs/cmd/spo/list/list-get.mdx +6 -0
  61. package/docs/docs/cmd/spo/list/list-roleassignment-add.mdx +15 -3
  62. package/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx +15 -3
  63. package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-ensure.mdx +4 -4
  64. package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.mdx +1 -1
  65. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-add.mdx +9 -9
  66. package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx +7 -7
  67. package/docs/docs/cmd/spo/site/site-recyclebinitem-list.mdx +1 -1
  68. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.mdx +79 -30
  69. package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +20 -19
  70. package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +84 -38
  71. package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +20 -19
  72. package/docs/docs/cmd/spo/web/web-roleassignment-add.mdx +1 -1
  73. package/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx +1 -1
  74. package/docs/docs/cmd/teams/meeting/meeting-list.mdx +7 -3
  75. package/npm-shrinkwrap.json +606 -845
  76. package/package.json +7 -3
@@ -0,0 +1,61 @@
1
+ import request from "../request.js";
2
+ export const drive = {
3
+ /**
4
+ * Retrieves the Drive associated with the specified site and URL.
5
+ * @param siteId Site ID
6
+ * @param url Drive URL
7
+ * @param logger The logger object
8
+ * @param verbose Set for verbose logging
9
+ * @returns The Drive associated with the drive URL.
10
+ */
11
+ async getDriveByUrl(siteId, url, logger, verbose) {
12
+ if (verbose && logger) {
13
+ await logger.logToStderr(`Retrieving drive information for URL: ${url.href}`);
14
+ }
15
+ const requestOptions = {
16
+ url: `https://graph.microsoft.com/v1.0/sites/${siteId}/drives?$select=webUrl,id`,
17
+ headers: {
18
+ accept: 'application/json;odata.metadata=none'
19
+ },
20
+ responseType: 'json'
21
+ };
22
+ const drives = await request.get(requestOptions);
23
+ const lowerCaseFolderUrl = url.href.toLowerCase();
24
+ const drive = drives.value
25
+ .sort((a, b) => b.webUrl.localeCompare(a.webUrl))
26
+ .find((d) => {
27
+ const driveUrl = d.webUrl.toLowerCase();
28
+ return lowerCaseFolderUrl.startsWith(driveUrl) &&
29
+ (driveUrl.length === lowerCaseFolderUrl.length ||
30
+ lowerCaseFolderUrl[driveUrl.length] === '/');
31
+ });
32
+ if (!drive) {
33
+ throw new Error(`Drive '${url.href}' not found`);
34
+ }
35
+ return drive;
36
+ },
37
+ /**
38
+ * Retrieves the ID of a drive item (file, folder, etc.) associated with the given drive and item URL.
39
+ * @param drive The Drive object containing the item
40
+ * @param itemUrl Item URL
41
+ * @param logger The logger object
42
+ * @param verbose Set for verbose logging
43
+ * @returns Drive item ID
44
+ */
45
+ async getDriveItemId(drive, itemUrl, logger, verbose) {
46
+ const relativeItemUrl = itemUrl.href.replace(new RegExp(`${drive.webUrl}`, 'i'), '').replace(/\/+$/, '');
47
+ if (verbose && logger) {
48
+ await logger.logToStderr(`Retrieving drive item ID for URL: ${relativeItemUrl}`);
49
+ }
50
+ const requestOptions = {
51
+ url: `https://graph.microsoft.com/v1.0/drives/${drive.id}/root${relativeItemUrl ? `:${relativeItemUrl}` : ''}?$select=id`,
52
+ headers: {
53
+ accept: 'application/json;odata.metadata=none'
54
+ },
55
+ responseType: 'json'
56
+ };
57
+ const driveItem = await request.get(requestOptions);
58
+ return driveItem?.id;
59
+ }
60
+ };
61
+ //# sourceMappingURL=drive.js.map
@@ -39,6 +39,22 @@ export const formatting = {
39
39
  parseJsonWithBom(s) {
40
40
  return JSON.parse(s.replace(/^\uFEFF/, ''));
41
41
  },
42
+ /**
43
+ * Tries to parse a string as JSON. If it fails, returns the original string.
44
+ * @param value JSON string to parse.
45
+ * @returns JSON object or the original string if parsing fails.
46
+ */
47
+ tryParseJson(value) {
48
+ try {
49
+ if (typeof value !== 'string') {
50
+ return value;
51
+ }
52
+ return JSON.parse(value);
53
+ }
54
+ catch {
55
+ return value;
56
+ }
57
+ },
42
58
  filterObject(obj, propertiesToInclude) {
43
59
  const objKeys = Object.keys(obj);
44
60
  return propertiesToInclude
package/dist/utils/spo.js CHANGED
@@ -454,15 +454,46 @@ export const spo = {
454
454
  const res = await request.get(requestOptions);
455
455
  return res.AadObjectId.NameId;
456
456
  },
457
+ /**
458
+ * Ensure a user exists on a specific SharePoint site.
459
+ * @param webUrl URL of the SharePoint site.
460
+ * @param logonName Logon name of the user to ensure on the SharePoint site.
461
+ * @returns SharePoint user object.
462
+ */
463
+ async ensureUser(webUrl, logonName) {
464
+ const requestOptions = {
465
+ url: `${webUrl}/_api/web/EnsureUser`,
466
+ headers: {
467
+ accept: 'application/json;odata=nometadata'
468
+ },
469
+ responseType: 'json',
470
+ data: {
471
+ logonName: logonName
472
+ }
473
+ };
474
+ return request.post(requestOptions);
475
+ },
476
+ /**
477
+ * Ensure a Microsoft Entra ID group exists on a specific SharePoint site.
478
+ * @param webUrl URL of the SharePoint site.
479
+ * @param group Microsoft Entra ID group.
480
+ * @returns SharePoint user object.
481
+ */
482
+ async ensureEntraGroup(webUrl, group) {
483
+ if (!group.securityEnabled) {
484
+ throw new Error('Cannot ensure a Microsoft Entra ID group that is not security enabled.');
485
+ }
486
+ return this.ensureUser(webUrl, group.mailEnabled ? `c:0o.c|federateddirectoryclaimprovider|${group.id}` : `c:0t.c|tenant|${group.id}`);
487
+ },
457
488
  /**
458
489
  * Retrieves the spo user by email.
459
490
  * @param webUrl Web url
460
491
  * @param email The email of the user
461
492
  * @param logger the Logger object
462
- * @param debug set if debug logging should be logged
493
+ * @param verbose set if verbose logging should be logged
463
494
  */
464
- async getUserByEmail(webUrl, email, logger, debug) {
465
- if (debug) {
495
+ async getUserByEmail(webUrl, email, logger, verbose) {
496
+ if (verbose) {
466
497
  await logger.logToStderr(`Retrieving the spo user by email ${email}`);
467
498
  }
468
499
  const requestUrl = `${webUrl}/_api/web/siteusers/GetByEmail('${formatting.encodeQueryParameter(email)}')`;
@@ -533,10 +564,10 @@ export const spo = {
533
564
  * @param webUrl Web url
534
565
  * @param name The name of the group
535
566
  * @param logger the Logger object
536
- * @param debug set if debug logging should be logged
567
+ * @param verbose set if verbose logging should be logged
537
568
  */
538
- async getGroupByName(webUrl, name, logger, debug) {
539
- if (debug) {
569
+ async getGroupByName(webUrl, name, logger, verbose) {
570
+ if (verbose) {
540
571
  await logger.logToStderr(`Retrieving the group by name ${name}`);
541
572
  }
542
573
  const requestUrl = `${webUrl}/_api/web/sitegroups/GetByName('${formatting.encodeQueryParameter(name)}')`;
@@ -1374,6 +1405,38 @@ export const spo = {
1374
1405
  const site = await request.get(requestOptions);
1375
1406
  return site.id;
1376
1407
  },
1408
+ /**
1409
+ * Retrieves the server-relative URL of a folder.
1410
+ * @param webUrl Web URL
1411
+ * @param folderUrl Folder URL
1412
+ * @param folderId Folder ID
1413
+ * @param logger The logger object
1414
+ * @param verbose Set for verbose logging
1415
+ * @returns The server-relative URL of the folder
1416
+ */
1417
+ async getFolderServerRelativeUrl(webUrl, folderUrl, folderId, logger, verbose) {
1418
+ if (verbose && logger) {
1419
+ await logger.logToStderr(`Retrieving server-relative URL for folder ${folderUrl ? `URL: ${folderUrl}` : `ID: ${folderId}`}`);
1420
+ }
1421
+ let requestUrl = `${webUrl}/_api/web/`;
1422
+ if (folderUrl) {
1423
+ const folderServerRelativeUrl = urlUtil.getServerRelativePath(webUrl, folderUrl);
1424
+ requestUrl += `GetFolderByServerRelativePath(decodedUrl='${formatting.encodeQueryParameter(folderServerRelativeUrl)}')`;
1425
+ }
1426
+ else {
1427
+ requestUrl += `GetFolderById('${folderId}')`;
1428
+ }
1429
+ requestUrl += '?$select=ServerRelativeUrl';
1430
+ const requestOptions = {
1431
+ url: requestUrl,
1432
+ headers: {
1433
+ accept: 'application/json;odata=nometadata'
1434
+ },
1435
+ responseType: 'json'
1436
+ };
1437
+ const res = await request.get(requestOptions);
1438
+ return res.ServerRelativeUrl;
1439
+ },
1377
1440
  /**
1378
1441
  * Retrieves the ObjectIdentity from a SharePoint site
1379
1442
  * @param webUrl web url
@@ -0,0 +1,124 @@
1
+ import { z } from 'zod';
2
+ function parseEffect(def, _options, _currentOption) {
3
+ return def.schema._def;
4
+ }
5
+ function parseIntersection(def, _options, _currentOption) {
6
+ if (def.left._def.typeName !== z.ZodFirstPartyTypeKind.ZodAny) {
7
+ return def.left._def;
8
+ }
9
+ if (def.right._def.typeName !== z.ZodFirstPartyTypeKind.ZodAny) {
10
+ return def.right._def;
11
+ }
12
+ return;
13
+ }
14
+ function parseObject(def, options, _currentOption) {
15
+ const properties = def.shape();
16
+ for (const key in properties) {
17
+ const property = properties[key];
18
+ const option = {
19
+ name: key,
20
+ long: key,
21
+ short: property._def.alias,
22
+ required: true,
23
+ type: 'string'
24
+ };
25
+ parseDef(property._def, options, option);
26
+ options.push(option);
27
+ }
28
+ return;
29
+ }
30
+ function parseString(_def, _options, currentOption) {
31
+ if (currentOption) {
32
+ currentOption.type = 'string';
33
+ }
34
+ return;
35
+ }
36
+ function parseNumber(_def, _options, currentOption) {
37
+ if (currentOption) {
38
+ currentOption.type = 'number';
39
+ }
40
+ return;
41
+ }
42
+ function parseBoolean(_def, _options, currentOption) {
43
+ if (currentOption) {
44
+ currentOption.type = 'boolean';
45
+ }
46
+ return;
47
+ }
48
+ function parseOptional(def, _options, currentOption) {
49
+ if (currentOption) {
50
+ currentOption.required = false;
51
+ }
52
+ return def.innerType._def;
53
+ }
54
+ function parseDefault(def, _options, currentOption) {
55
+ if (currentOption) {
56
+ currentOption.required = false;
57
+ }
58
+ return def.innerType._def;
59
+ }
60
+ function parseEnum(def, _options, currentOption) {
61
+ if (currentOption) {
62
+ currentOption.type = 'string';
63
+ currentOption.autocomplete = def.values;
64
+ }
65
+ return;
66
+ }
67
+ function parseNativeEnum(def, _options, currentOption) {
68
+ if (currentOption) {
69
+ currentOption.type = 'string';
70
+ currentOption.autocomplete = Object.getOwnPropertyNames(def.values);
71
+ }
72
+ return;
73
+ }
74
+ function getParseFn(typeName) {
75
+ switch (typeName) {
76
+ case z.ZodFirstPartyTypeKind.ZodEffects:
77
+ return parseEffect;
78
+ case z.ZodFirstPartyTypeKind.ZodObject:
79
+ return parseObject;
80
+ case z.ZodFirstPartyTypeKind.ZodOptional:
81
+ return parseOptional;
82
+ case z.ZodFirstPartyTypeKind.ZodString:
83
+ return parseString;
84
+ case z.ZodFirstPartyTypeKind.ZodNumber:
85
+ return parseNumber;
86
+ case z.ZodFirstPartyTypeKind.ZodBoolean:
87
+ return parseBoolean;
88
+ case z.ZodFirstPartyTypeKind.ZodEnum:
89
+ return parseEnum;
90
+ case z.ZodFirstPartyTypeKind.ZodNativeEnum:
91
+ return parseNativeEnum;
92
+ case z.ZodFirstPartyTypeKind.ZodDefault:
93
+ return parseDefault;
94
+ case z.ZodFirstPartyTypeKind.ZodIntersection:
95
+ return parseIntersection;
96
+ default:
97
+ return;
98
+ }
99
+ }
100
+ function parseDef(def, options, currentOption) {
101
+ let parsedDef = def;
102
+ do {
103
+ const parse = getParseFn(parsedDef.typeName);
104
+ if (!parse) {
105
+ break;
106
+ }
107
+ parsedDef = parse(parsedDef, options, currentOption);
108
+ if (!parsedDef) {
109
+ break;
110
+ }
111
+ } while (parsedDef);
112
+ }
113
+ export const zod = {
114
+ alias(alias, type) {
115
+ type._def.alias = alias;
116
+ return type;
117
+ },
118
+ schemaToOptions(schema) {
119
+ const options = [];
120
+ parseDef(schema._def, options);
121
+ return options;
122
+ }
123
+ };
124
+ //# sourceMappingURL=zod.js.map
@@ -15,7 +15,7 @@ m365 connection use [options]
15
15
  ## Options
16
16
 
17
17
  ```md definition-list
18
- `-n, --name <name>`
18
+ `-n, --name [name]`
19
19
  : The name of the connection to switch to.
20
20
  ```
21
21
 
@@ -23,7 +23,13 @@ m365 connection use [options]
23
23
 
24
24
  ## Remarks
25
25
 
26
- The value for `--name` can be found by running [m365 connection list](connection-list.mdx). You can update the name of a connection by running [m365 connection set](connection-set.mdx).
26
+ :::tip
27
+
28
+ If you haven't disabled the "prompt" setting, running this command without options will show a list of available connections. You can then select the connection to activate it.
29
+
30
+ :::
31
+
32
+ You can update the name of a connection by running [m365 connection set](connection-set.mdx).
27
33
 
28
34
  ## Examples
29
35
 
@@ -26,13 +26,25 @@ m365 teams user add
26
26
 
27
27
  ```md definition-list
28
28
  `-i, --groupId [groupId]`
29
- : The ID of the Microsoft 365 Group to which to add the user
29
+ : The ID of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
30
+
31
+ `--groupName [groupName]`
32
+ : The display name of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
30
33
 
31
34
  `--teamId [teamId]`
32
- : The ID of the Teams team to which to add the user
35
+ : The ID of the Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
36
+
37
+ `--teamName [teamName]`
38
+ : The display name of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
39
+
40
+ `-n, --userName [userName]`
41
+ : (deprecated) User's UPN (User Principal Name), e.g. johndoe@example.com.
42
+
43
+ `--ids [ids]`
44
+ : Microsoft Entra IDs of users. You can also pass a comma-separated list of IDs. Specify either `ids` or `userNames` but not both.
33
45
 
34
- `-n, --userName <userName>`
35
- : User's UPN (user principal name, eg. johndoe@example.com)
46
+ `--userNames [userNames]`
47
+ : The user principal names of users. You can also pass a comma-separated list of UPNs. Specify either `ids` or `userNames` but not both.
36
48
 
37
49
  `-r, --role [role]`
38
50
  : The role to be assigned to the new user: `Owner,Member`. Default `Member`
@@ -42,22 +54,28 @@ m365 teams user add
42
54
 
43
55
  ## Examples
44
56
 
45
- Add a new member to the specified Microsoft 365 Group
57
+ Add a new member with the userNames parameter to the specified Microsoft 365 Group
58
+
59
+ ```sh
60
+ m365 entra m365group user add --groupId '00000000-0000-0000-0000-000000000000' --userNames 'anne.matthews@contoso.onmicrosoft.com'
61
+ ```
62
+
63
+ Add multiple new owners with the userNames parameter to the specified Microsoft 365 Group
46
64
 
47
65
  ```sh
48
- m365 entra m365group user add --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com'
66
+ m365 entra m365group user add --groupName 'Contoso' --userNames 'anne.matthews@contoso.onmicrosoft.com, john.doe@contoso.onmicrosoft.com' --role Owner
49
67
  ```
50
68
 
51
- Add a new owner to the specified Microsoft 365 Group
69
+ Add a new member with the userNames parameter to the specified Microsoft Teams team
52
70
 
53
71
  ```sh
54
- m365 entra m365group user add --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --role Owner
72
+ m365 entra m365group member add --teamId '00000000-0000-0000-0000-000000000000' --userNames 'anne.matthews@contoso.onmicrosoft.com' --role Member
55
73
  ```
56
74
 
57
- Add a new member to the specified Microsoft Teams team
75
+ Add multiple new members with the ids parameter to the specified Microsoft Teams team
58
76
 
59
77
  ```sh
60
- m365 teams user add --teamId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com'
78
+ m365 entra m365group user add --teamName 'Engineering' --ids '74a3b772-3122-447b-b9da-10895e238219,dd3d21e4-a142-46b9-8482-bca8fe9596b3' --role Member
61
79
  ```
62
80
 
63
81
  ## Response
@@ -2,7 +2,7 @@ import Global from '/docs/cmd/_global.mdx';
2
2
 
3
3
  # entra m365group user set
4
4
 
5
- Updates role of the specified user in the specified Microsoft 365 Group or Microsoft Teams team
5
+ Updates role of the specified users in the specified Microsoft 365 Group or Microsoft Teams team
6
6
 
7
7
  ## Usage
8
8
 
@@ -24,13 +24,25 @@ m365 aad teams user set
24
24
 
25
25
  ```md definition-list
26
26
  `-i, --groupId [groupId]`
27
- : The ID of the Microsoft 365 group for which to update user
27
+ : The ID of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
28
+
29
+ `--groupName [groupName]`
30
+ : The display name of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
28
31
 
29
32
  `--teamId [teamId]`
30
- : The ID of the Microsoft Teams team for which to update user
33
+ : The ID of the Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
34
+
35
+ `--teamName [teamName]`
36
+ : The display name of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.
37
+
38
+ `-n, --userName [userName]`
39
+ : (deprecated) User's UPN (User Principal Name), e.g. johndoe@example.com.
31
40
 
32
- `-n, --userName <userName>`
33
- : UPN of the user for whom to update the role (eg. johndoe@example.com)
41
+ `--ids [ids]`
42
+ : Microsoft Entra IDs of users. You can also pass a comma-separated list of IDs. Specify only one of the following `userName`, `ids` or `userNames`.
43
+
44
+ `--userNames [userNames]`
45
+ : The user principal names of users. You can also pass a comma-separated list of UPNs. Specify only one of the following `userName`, `ids` or `userNames`.
34
46
 
35
47
  `-r, --role <role>`
36
48
  : Role to set for the given user in the specified Microsoft 365 Group or Microsoft Teams team. Allowed values: `Owner`, `Member`
@@ -44,28 +56,40 @@ The command will return an error if the user already has the specified role in t
44
56
 
45
57
  ## Examples
46
58
 
47
- Promote the specified user to owner of the given Microsoft 365 Group
59
+ Promote a single user to Owner of the given Microsoft 365 Group
48
60
 
49
61
  ```sh
50
62
  m365 entra m365group user set --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --role Owner
51
63
  ```
52
64
 
53
- Demote the specified user from owner to member in the given Microsoft 365 Group
65
+ Promote multiple users specified by the userNames parameter to Owner of the given Microsoft 365 Group
66
+
67
+ ```sh
68
+ m365 entra m365group user set --groupName 'Contoso' --userNames 'anne.matthews@contoso.onmicrosoft.com,john.doe@contoso.onmicrosoft.com' --role Owner
69
+ ```
70
+
71
+ Promote multiple users specified by the ids parameter to Owner of the given Microsoft 365 Group
72
+
73
+ ```sh
74
+ m365 entra m365group user set --groupId '00000000-0000-0000-0000-000000000000' --ids '74a3b772-3122-447b-b9da-10895e238219,dd3d21e4-a142-46b9-8482-bca8fe9596b3' --role Owner
75
+ ```
76
+
77
+ Demote a single user from Owner to Member in the given Microsoft 365 Group
54
78
 
55
79
  ```sh
56
80
  m365 entra m365group user set --groupId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --role Member
57
81
  ```
58
82
 
59
- Promote the specified user to owner of the given Microsoft Teams team
83
+ Demote multiple users specified by the userNames parameter from Owner to Member of the given Microsoft Teams team
60
84
 
61
85
  ```sh
62
- m365 entra teams user set --teamId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --role Owner
86
+ m365 entra teams user set --teamId '00000000-0000-0000-0000-000000000000' --userNames 'anne.matthews@contoso.onmicrosoft.com,john.doe@contoso.onmicrosoft.com' --role Member
63
87
  ```
64
88
 
65
- Demote the specified user from owner to member in the given Microsoft Teams team
89
+ Demote multiple users specified by the ids parameter from Owner to Member in the given Microsoft Teams team
66
90
 
67
91
  ```sh
68
- m365 entra teams user set --teamId '00000000-0000-0000-0000-000000000000' --userName 'anne.matthews@contoso.onmicrosoft.com' --role Member
92
+ m365 entra teams user set --teamName 'Engineering' --ids '74a3b772-3122-447b-b9da-10895e238219,dd3d21e4-a142-46b9-8482-bca8fe9596b3' --role Member
69
93
  ```
70
94
 
71
95
  ## Response
@@ -0,0 +1,107 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
4
+
5
+ # entra multitenant add
6
+
7
+ Creates a new multitenant organization
8
+
9
+ ## Usage
10
+
11
+ ```sh
12
+ m365 entra multitenant add [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ ```md definition-list
18
+ `-n, --displayname <displayName>`
19
+ : Display name for the multitenant organization.
20
+
21
+ `-d, --description [description]`
22
+ : Description for the multitenant organiztion.
23
+ ```
24
+
25
+ <Global />
26
+
27
+ ## Remarks
28
+
29
+ :::info
30
+
31
+ To use this command you must be at least **Security Administrator**.
32
+
33
+ :::
34
+
35
+ ## Examples
36
+
37
+ Create a new multitenant organization with display name only.
38
+
39
+ ```sh
40
+ m365 entra multitenant add --displayName 'Contoso organization'
41
+ ```
42
+
43
+ Create a new multitenant organization with display name and description.
44
+
45
+ ```sh
46
+ m365 entra multitenant add --displayName 'Contoso organization' --description 'Multitenant organization between Contoso, Fabrikam, and Woodgrove Bank'
47
+ ```
48
+
49
+ ## Response
50
+
51
+ <Tabs>
52
+ <TabItem value="JSON">
53
+
54
+ ```json
55
+ {
56
+ "id": "c231d4a5-138f-4bdf-9fee-f26a90ea3ad0",
57
+ "createdDateTime": "2024-05-05T05:05:05Z",
58
+ "state": "active",
59
+ "displayName": "Contoso organization",
60
+ "description": "Multitenant organization between Contoso, Fabrikam, and Woodgrove Bank"
61
+ }
62
+ ```
63
+
64
+ </TabItem>
65
+ <TabItem value="Text">
66
+
67
+ ```text
68
+ createdDateTime: 2024-05-05T05:05:05Z
69
+ description : Multitenant organization between Contoso, Fabrikam, and Woodgrove Bank
70
+ displayName : Contoso organization
71
+ id : c231d4a5-138f-4bdf-9fee-f26a90ea3ad0
72
+ state : active
73
+ ```
74
+
75
+ </TabItem>
76
+ <TabItem value="CSV">
77
+
78
+ ```csv
79
+ id,createdDateTime,state,displayName,description
80
+ c231d4a5-138f-4bdf-9fee-f26a90ea3ad0,2024-05-05T05:05:05Z,active,Contoso organization,"Multitenant organization between Contoso, Fabrikam, and Woodgrove Bank"
81
+ ```
82
+
83
+ </TabItem>
84
+ <TabItem value="Markdown">
85
+
86
+ ```md
87
+ # entra multitenant add
88
+
89
+ Date: 5/5/2024
90
+
91
+ ## Contoso organization (c231d4a5-138f-4bdf-9fee-f26a90ea3ad0)
92
+
93
+ Property | Value
94
+ ---------|-------
95
+ id | c231d4a5-138f-4bdf-9fee-f26a90ea3ad0
96
+ createdDateTime | 2024-05-05T05:05:05Z
97
+ state | active
98
+ displayName | Contoso organization
99
+ description | Multitenant organization between Contoso, Fabrikam, and Woodgrove Bank
100
+ ```
101
+
102
+ </TabItem>
103
+ </Tabs>
104
+
105
+ ## More information
106
+
107
+ - Multitenant organization: https://learn.microsoft.com/entra/identity/multi-tenant-organizations/overview
@@ -0,0 +1,58 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+
3
+ # entra multitenant remove
4
+
5
+ Removes a multitenant organization
6
+
7
+ ## Usage
8
+
9
+ ```sh
10
+ m365 entra multitenant remove [options]
11
+ ```
12
+
13
+ ## options
14
+
15
+ ```md definition-list
16
+ `-f, --force`
17
+ : Don't prompt for confirmation.
18
+ ```
19
+
20
+ <Global />
21
+
22
+ ## Remarks
23
+
24
+ :::info
25
+
26
+ To use this command you must be at least **Security Administrator**.
27
+
28
+ :::
29
+
30
+ :::info
31
+
32
+ When removing a Multi-Tenant Organization, all associations with other tenants will be removed too.
33
+
34
+ The removing process can take up to 2 hours to complete.
35
+
36
+ :::
37
+
38
+ ## Examples
39
+
40
+ Remove the multitenant organization.
41
+
42
+ ```sh
43
+ m365 entra multitenant remove
44
+ ```
45
+
46
+ Remove the multitenant organization without prompting for confirmation.
47
+
48
+ ```sh
49
+ m365 entra multitenant remove --force
50
+ ```
51
+
52
+ ## Response
53
+
54
+ The command won't return a response on success
55
+
56
+ ## More information
57
+
58
+ - Multitenant organization: https://learn.microsoft.com/entra/identity/multi-tenant-organizations/overview