@pnp/cli-microsoft365 9.0.0-beta.1cfb646 → 9.0.0-beta.2b15817

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 (33) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-remove.js +123 -0
  4. package/dist/m365/entra/commands/group/group-set.js +256 -0
  5. package/dist/m365/entra/commands/m365group/m365group-user-add.js +109 -32
  6. package/dist/m365/entra/commands/m365group/m365group-user-set.js +159 -84
  7. package/dist/m365/entra/commands.js +3 -0
  8. package/dist/m365/flow/commands/flow-get.js +1 -1
  9. package/dist/m365/pa/commands/app/app-export.js +13 -7
  10. package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +86 -0
  11. package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +110 -0
  12. package/dist/m365/spo/commands/list/ListInstance.js +6 -1
  13. package/dist/m365/spo/commands/list/list-get.js +9 -3
  14. package/dist/m365/spo/commands.js +2 -0
  15. package/dist/m365/teams/commands/message/message-restore.js +106 -0
  16. package/dist/m365/teams/commands.js +1 -0
  17. package/dist/utils/drive.js +61 -0
  18. package/dist/utils/spo.js +32 -0
  19. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-remove.mdx +65 -0
  20. package/docs/docs/cmd/entra/group/group-add.mdx +0 -4
  21. package/docs/docs/cmd/entra/group/group-set.mdx +89 -0
  22. package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +28 -10
  23. package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +35 -11
  24. package/docs/docs/cmd/flow/flow-get.mdx +149 -283
  25. package/docs/docs/cmd/pa/app/app-export.mdx +15 -9
  26. package/docs/docs/cmd/spo/app/app-uninstall.mdx +1 -1
  27. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +110 -0
  28. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +114 -0
  29. package/docs/docs/cmd/spo/list/list-get.mdx +6 -0
  30. package/docs/docs/cmd/teams/message/message-remove.mdx +2 -1
  31. package/docs/docs/cmd/teams/message/message-restore.mdx +62 -0
  32. package/npm-shrinkwrap.json +572 -477
  33. package/package.json +22 -22
@@ -10,6 +10,7 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import SpoCommand from '../../../base/SpoCommand.js';
12
12
  import commands from '../../commands.js';
13
+ import { DefaultTrimModeType } from "./ListInstance.js";
13
14
  import { ListPrincipalType } from './ListPrincipalType.js';
14
15
  class SpoListGetCommand extends SpoCommand {
15
16
  get name() {
@@ -49,9 +50,11 @@ class SpoListGetCommand extends SpoCommand {
49
50
  if (fieldsProperties.expandProperties.length > 0) {
50
51
  queryParams.push(`$expand=${fieldsProperties.expandProperties.join(',')}`);
51
52
  }
52
- const querystring = queryParams.length > 0 ? `?${queryParams.join('&')}` : ``;
53
+ if (queryParams.length === 0) {
54
+ queryParams.push(`$expand=VersionPolicies`);
55
+ }
53
56
  const requestOptions = {
54
- url: `${requestUrl}${querystring}`,
57
+ url: `${requestUrl}?${queryParams.join('&')}`,
55
58
  headers: {
56
59
  'accept': 'application/json;odata=nometadata'
57
60
  },
@@ -64,6 +67,9 @@ class SpoListGetCommand extends SpoCommand {
64
67
  r.Member.PrincipalTypeString = ListPrincipalType[r.Member.PrincipalType];
65
68
  });
66
69
  }
70
+ if (listInstance.VersionPolicies) {
71
+ listInstance.VersionPolicies.DefaultTrimModeValue = DefaultTrimModeType[listInstance.VersionPolicies.DefaultTrimMode];
72
+ }
67
73
  await logger.log(listInstance);
68
74
  }
69
75
  catch (err) {
@@ -74,7 +80,7 @@ class SpoListGetCommand extends SpoCommand {
74
80
  const selectProperties = [];
75
81
  let expandProperties = [];
76
82
  if (withPermissions) {
77
- expandProperties = ['HasUniqueRoleAssignments', 'RoleAssignments/Member', 'RoleAssignments/RoleDefinitionBindings'];
83
+ expandProperties = ['HasUniqueRoleAssignments', 'RoleAssignments/Member', 'RoleAssignments/RoleDefinitionBindings', 'VersionPolicies'];
78
84
  }
79
85
  if (properties) {
80
86
  properties.split(',').forEach((property) => {
@@ -99,6 +99,8 @@ export default {
99
99
  FOLDER_ROLEASSIGNMENT_ADD: `${prefix} folder roleassignment add`,
100
100
  FOLDER_ROLEINHERITANCE_BREAK: `${prefix} folder roleinheritance break`,
101
101
  FOLDER_ROLEINHERITANCE_RESET: `${prefix} folder roleinheritance reset`,
102
+ FOLDER_SHARINGLINK_GET: `${prefix} folder sharinglink get`,
103
+ FOLDER_SHARINGLINK_LIST: `${prefix} folder sharinglink list`,
102
104
  GET: `${prefix} get`,
103
105
  GROUP_ADD: `${prefix} group add`,
104
106
  GROUP_GET: `${prefix} group get`,
@@ -0,0 +1,106 @@
1
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
+ 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");
4
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
+ };
6
+ var _TeamsMessageRestoreCommand_instances, _TeamsMessageRestoreCommand_initTelemetry, _TeamsMessageRestoreCommand_initOptions, _TeamsMessageRestoreCommand_initValidators, _TeamsMessageRestoreCommand_initOptionSets, _TeamsMessageRestoreCommand_initTypes;
7
+ import request from '../../../../request.js';
8
+ import { validation } from '../../../../utils/validation.js';
9
+ import commands from '../../commands.js';
10
+ import DelegatedGraphCommand from '../../../base/DelegatedGraphCommand.js';
11
+ import { teams } from '../../../../utils/teams.js';
12
+ class TeamsMessageRestoreCommand extends DelegatedGraphCommand {
13
+ get name() {
14
+ return commands.MESSAGE_RESTORE;
15
+ }
16
+ get description() {
17
+ return 'Restores a deleted message from a channel in a Microsoft Teams team';
18
+ }
19
+ constructor() {
20
+ super();
21
+ _TeamsMessageRestoreCommand_instances.add(this);
22
+ __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initTelemetry).call(this);
23
+ __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initOptions).call(this);
24
+ __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initValidators).call(this);
25
+ __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initOptionSets).call(this);
26
+ __classPrivateFieldGet(this, _TeamsMessageRestoreCommand_instances, "m", _TeamsMessageRestoreCommand_initTypes).call(this);
27
+ }
28
+ async commandAction(logger, args) {
29
+ try {
30
+ if (this.verbose) {
31
+ await logger.logToStderr(`Restoring deleted message '${args.options.id}' from channel '${args.options.channelId || args.options.channelName}' in the Microsoft Teams team '${args.options.teamId || args.options.teamName}'.`);
32
+ }
33
+ const teamId = await this.getTeamId(args.options, logger);
34
+ const channelId = await this.getChannelId(args.options, teamId, logger);
35
+ const requestOptions = {
36
+ url: `${this.resource}/v1.0/teams/${teamId}/channels/${channelId}/messages/${args.options.id}/undoSoftDelete`,
37
+ headers: {
38
+ accept: 'application/json;odata.metadata=none'
39
+ },
40
+ responseType: 'json'
41
+ };
42
+ await request.post(requestOptions);
43
+ }
44
+ catch (err) {
45
+ this.handleRejectedODataJsonPromise(err);
46
+ }
47
+ }
48
+ async getTeamId(options, logger) {
49
+ if (options.teamId) {
50
+ return options.teamId;
51
+ }
52
+ if (this.verbose) {
53
+ await logger.logToStderr(`Getting the Team ID.`);
54
+ }
55
+ const groupId = await teams.getTeamIdByDisplayName(options.teamName);
56
+ return groupId;
57
+ }
58
+ async getChannelId(options, teamId, logger) {
59
+ if (options.channelId) {
60
+ return options.channelId;
61
+ }
62
+ if (this.verbose) {
63
+ await logger.logToStderr(`Getting the channel ID.`);
64
+ }
65
+ const channelId = await teams.getChannelIdByDisplayName(teamId, options.channelName);
66
+ return channelId;
67
+ }
68
+ }
69
+ _TeamsMessageRestoreCommand_instances = new WeakSet(), _TeamsMessageRestoreCommand_initTelemetry = function _TeamsMessageRestoreCommand_initTelemetry() {
70
+ this.telemetry.push((args) => {
71
+ Object.assign(this.telemetryProperties, {
72
+ teamId: typeof args.options.teamId !== 'undefined',
73
+ teamName: typeof args.options.teamName !== 'undefined',
74
+ channelId: typeof args.options.channelId !== 'undefined',
75
+ channelName: typeof args.options.channelName !== 'undefined'
76
+ });
77
+ });
78
+ }, _TeamsMessageRestoreCommand_initOptions = function _TeamsMessageRestoreCommand_initOptions() {
79
+ this.options.unshift({
80
+ option: '--teamId [teamId]'
81
+ }, {
82
+ option: '--teamName [teamName]'
83
+ }, {
84
+ option: '--channelId [channelId]'
85
+ }, {
86
+ option: '--channelName [channelName]'
87
+ }, {
88
+ option: '-i, --id <id>'
89
+ });
90
+ }, _TeamsMessageRestoreCommand_initValidators = function _TeamsMessageRestoreCommand_initValidators() {
91
+ this.validators.push(async (args) => {
92
+ if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
93
+ return `'${args.options.teamId}' is not a valid GUID for 'teamId'.`;
94
+ }
95
+ if (args.options.channelId && !validation.isValidTeamsChannelId(args.options.channelId)) {
96
+ return `'${args.options.channelId}' is not a valid ID for 'channelId'.`;
97
+ }
98
+ return true;
99
+ });
100
+ }, _TeamsMessageRestoreCommand_initOptionSets = function _TeamsMessageRestoreCommand_initOptionSets() {
101
+ this.optionSets.push({ options: ['teamId', 'teamName'] }, { options: ['channelId', 'channelName'] });
102
+ }, _TeamsMessageRestoreCommand_initTypes = function _TeamsMessageRestoreCommand_initTypes() {
103
+ this.types.string.push('teamId', 'teamName', 'channelId', 'channelName', 'id');
104
+ };
105
+ export default new TeamsMessageRestoreCommand();
106
+ //# sourceMappingURL=message-restore.js.map
@@ -39,6 +39,7 @@ export default {
39
39
  MESSAGE_LIST: `${prefix} message list`,
40
40
  MESSAGE_REMOVE: `${prefix} message remove`,
41
41
  MESSAGE_REPLY_LIST: `${prefix} message reply list`,
42
+ MESSAGE_RESTORE: `${prefix} message restore`,
42
43
  MESSAGE_SEND: `${prefix} message send`,
43
44
  MESSAGINGSETTINGS_LIST: `${prefix} messagingsettings list`,
44
45
  MESSAGINGSETTINGS_SET: `${prefix} messagingsettings set`,
@@ -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
package/dist/utils/spo.js CHANGED
@@ -1415,6 +1415,38 @@ export const spo = {
1415
1415
  const site = await request.get(requestOptions);
1416
1416
  return site.id;
1417
1417
  },
1418
+ /**
1419
+ * Retrieves the server-relative URL of a folder.
1420
+ * @param webUrl Web URL
1421
+ * @param folderUrl Folder URL
1422
+ * @param folderId Folder ID
1423
+ * @param logger The logger object
1424
+ * @param verbose Set for verbose logging
1425
+ * @returns The server-relative URL of the folder
1426
+ */
1427
+ async getFolderServerRelativeUrl(webUrl, folderUrl, folderId, logger, verbose) {
1428
+ if (verbose && logger) {
1429
+ await logger.logToStderr(`Retrieving server-relative URL for folder ${folderUrl ? `URL: ${folderUrl}` : `ID: ${folderId}`}`);
1430
+ }
1431
+ let requestUrl = `${webUrl}/_api/web/`;
1432
+ if (folderUrl) {
1433
+ const folderServerRelativeUrl = urlUtil.getServerRelativePath(webUrl, folderUrl);
1434
+ requestUrl += `GetFolderByServerRelativePath(decodedUrl='${formatting.encodeQueryParameter(folderServerRelativeUrl)}')`;
1435
+ }
1436
+ else {
1437
+ requestUrl += `GetFolderById('${folderId}')`;
1438
+ }
1439
+ requestUrl += '?$select=ServerRelativeUrl';
1440
+ const requestOptions = {
1441
+ url: requestUrl,
1442
+ headers: {
1443
+ accept: 'application/json;odata=nometadata'
1444
+ },
1445
+ responseType: 'json'
1446
+ };
1447
+ const res = await request.get(requestOptions);
1448
+ return res.ServerRelativeUrl;
1449
+ },
1418
1450
  /**
1419
1451
  * Retrieves the ObjectIdentity from a SharePoint site
1420
1452
  * @param webUrl web url
@@ -0,0 +1,65 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
4
+
5
+ # entra enterpriseapp remove
6
+
7
+ Deletes an enterprise application (or service principal)
8
+
9
+ ## Usage
10
+
11
+ ```sh
12
+ m365 entra enterpriseapp remove [options]
13
+ ```
14
+
15
+ ## Alias
16
+
17
+ ```sh
18
+ m365 entra sp remove [options]
19
+ ```
20
+
21
+ ## Options
22
+
23
+ ```md definition-list
24
+ `-i, --id [id]`
25
+ : ID of the enterprise application.
26
+
27
+ `-n, --displayName [displayName]`
28
+ : Display name of the enterprise application.
29
+
30
+ `--objectId [objectId]`
31
+ : ObjectId of the enterprise application.
32
+
33
+ `-f, --force`
34
+ : Don't prompt for confirmation.
35
+ ```
36
+
37
+ <Global />
38
+
39
+ ## Examples
40
+
41
+ Delete an enterprise application by application ID.
42
+
43
+ ```sh
44
+ m365 entra enterpriseapp remove --id b2307a39-e878-458b-bc90-03bc578531d6 --force
45
+ ```
46
+
47
+ Delete an enterprise application by display name.
48
+
49
+ ```sh
50
+ m365 entra enterpriseapp remove --displayName "Contoso app"
51
+ ```
52
+
53
+ Delete an enterprise application by object ID.
54
+
55
+ ```sh
56
+ m365 entra enterpriseapp remove --objectId b2307a39-e878-458b-bc90-03bc578531dd
57
+ ```
58
+
59
+ ## Response
60
+
61
+ The command won't return a response on success.
62
+
63
+ ## More information
64
+
65
+ - Application and service principal objects in Microsoft Entra ID: [https://learn.microsoft.com/azure/active-directory/develop/active-directory-application-objects](https://learn.microsoft.com/azure/active-directory/develop/active-directory-application-objects)
@@ -53,8 +53,6 @@ m365 aad group add [options]
53
53
 
54
54
  ## Remarks
55
55
 
56
- :::info
57
-
58
56
  The `visibility` option affects the behavior of the group.
59
57
 
60
58
  With the `Public` visibility:
@@ -74,8 +72,6 @@ With the `HiddenMembership` visibility:
74
72
  - Administrators (global, company, user, and helpdesk) can view the membership of the group.
75
73
  - The group appears in the global address book (GAL).
76
74
 
77
- :::
78
-
79
75
  :::note
80
76
 
81
77
  The `HiddenMembership` visibility can be set only for Microsoft 365 groups when the groups are created. It can't be updated later.
@@ -0,0 +1,89 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+
3
+ # entra group set
4
+
5
+ Updates a Microsoft Entra group
6
+
7
+ ## Usage
8
+
9
+ ```sh
10
+ m365 entra group set [options]
11
+ ```
12
+
13
+ ## Options
14
+
15
+ ```md definition-list
16
+ `-i, --id [id]`
17
+ : The ID of the Microsoft Entra group to update. Specify either `id` or `displayName` but not both.
18
+
19
+ `-n, --displayName [displayName]`
20
+ : The display name of the Microsoft Entra group to update. Specify either `id` or `displayName` but not both.
21
+
22
+ `--newDisplayName [newDisplayName]`
23
+ : The new display name of the Microsoft Entra group. The maximum length is 256 characters.
24
+
25
+ `--description [description]`
26
+ : The new description for the group.
27
+
28
+ `--mailNickname [mailNickname]`
29
+ : The new mail alias for the group (part before the @). Use only for mail-enabled groups. Maximum length is 64 characters.
30
+
31
+ `--ownerIds [ownerIds]`
32
+ : Comma-separated list of IDs of Microsoft Entra users that will be the group owners. Specify either `ownerIds` or `ownerUserNames`, but not both.
33
+
34
+ `--ownerUserNames [ownerUserNames]`
35
+ : Comma-separated list of UPNs of Microsoft Entra users that will be the group owners. Specify either `ownerIds` or `ownerUserNames`, but not both.
36
+
37
+ `--memberIds [memberIds]`
38
+ : Comma-separated list of IDs of Microsoft Entra users that will be the group members. Specify either `memberIds` or `memberUserNames`, but not both.
39
+
40
+ `--memberUserNames [memberUserNames]`
41
+ : Comma-separated list of UPNs of Microsoft Entra users that will be the group members. Specify either `memberIds` or `memberUserNames`, but not both.
42
+
43
+ `--visibility [visibility]`
44
+ : Specifies the group join policy and group content visibility for Microsoft 365 groups. Possible values are: `Private` or `Public`. Specify only when targeting a Microsoft 365 group.
45
+ ```
46
+
47
+ <Global />
48
+
49
+ ## Remarks
50
+
51
+ The `visibility` option affects the behavior of the group.
52
+
53
+ With the `Public` visibility:
54
+ - Anyone can join the group without needing owner approval.
55
+ - Anyone can view the attributes of the group.
56
+ - Anyone can see the members of the group.
57
+
58
+ With the `Private` visibilty:
59
+ - Owner approval is needed to join the group.
60
+ - Anyone can view the attributes of the group.
61
+ - Anyone can see the members of the group.
62
+
63
+ If the specified option is not found, you will receive a `Resource 'xyz' does not exist or one of its queried reference-property objects are not present.` error.
64
+
65
+ Specifying `memberIds` or `memberUserNames` will make only those users members, removing all others. Similarly, specifying `ownerIds` or `ownerUserNames` will make only those users owners, removing all others.
66
+
67
+ ## Examples
68
+
69
+ Update the display name of a group specified by the display name
70
+
71
+ ```sh
72
+ m365 entra group set --displayName Devs --newDisplayName Developers
73
+ ```
74
+
75
+ Set the owners of a group to the specified people
76
+
77
+ ```sh
78
+ m365 entra group set --id 57fd6b33-54eb-42b0-9ea0-8a9ac04eab7d --ownerUserNames "john.doe@contoso.com,adele.vance@contoso.com"
79
+ ```
80
+
81
+ Update the description and mail nickname of a group
82
+
83
+ ```sh
84
+ m365 entra group set --id 57fd6b33-54eb-42b0-9ea0-8a9ac04eab7d --description "All developers of the company" --mailNickname developers
85
+ ```
86
+
87
+ ## Response
88
+
89
+ The command won't return a response on success.
@@ -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