@pnp/cli-microsoft365 9.0.0-beta.e16d09c → 9.0.0-beta.f2c5f82

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 (95) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/cli/cli.js +11 -6
  4. package/dist/config.js +1 -1
  5. package/dist/m365/app/commands/permission/permission-add.js +9 -9
  6. package/dist/m365/cli/commands/cli-consent.js +3 -7
  7. package/dist/m365/commands/status.js +2 -2
  8. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +13 -13
  9. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +18 -18
  10. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +1 -1
  11. package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-remove.js +123 -0
  12. package/dist/m365/entra/commands/group/group-set.js +256 -0
  13. package/dist/m365/entra/commands/group/group-user-list.js +4 -4
  14. package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +4 -4
  15. package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +3 -3
  16. package/dist/m365/entra/commands/m365group/m365group-user-add.js +109 -32
  17. package/dist/m365/entra/commands/m365group/m365group-user-list.js +6 -9
  18. package/dist/m365/entra/commands/m365group/m365group-user-set.js +159 -84
  19. package/dist/m365/entra/commands.js +3 -0
  20. package/dist/m365/flow/commands/flow-get.js +1 -1
  21. package/dist/m365/outlook/commands/message/message-get.js +11 -11
  22. package/dist/m365/pa/commands/app/app-export.js +13 -7
  23. package/dist/m365/spfx/commands/project/DeployWorkflow.js +1 -1
  24. package/dist/m365/spfx/commands/project/project-github-workflow-add.js +1 -10
  25. package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +0 -1
  26. package/dist/m365/spo/commands/file/file-copy.js +55 -34
  27. package/dist/m365/spo/commands/folder/folder-set.js +0 -4
  28. package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +86 -0
  29. package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +110 -0
  30. package/dist/m365/spo/commands/list/ListInstance.js +6 -1
  31. package/dist/m365/spo/commands/list/list-get.js +9 -3
  32. package/dist/m365/spo/commands/list/list-list.js +1 -4
  33. package/dist/m365/spo/commands/site/site-appcatalog-remove.js +48 -24
  34. package/dist/m365/spo/commands/site/site-remove.js +1 -7
  35. package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +2 -22
  36. package/dist/m365/spo/commands.js +2 -1
  37. package/dist/m365/teams/commands/message/message-restore.js +106 -0
  38. package/dist/m365/teams/commands.js +1 -0
  39. package/dist/m365/viva/commands/engage/engage-group-list.js +0 -5
  40. package/dist/m365/viva/commands/engage/engage-group-user-add.js +0 -5
  41. package/dist/m365/viva/commands/engage/engage-group-user-remove.js +0 -5
  42. package/dist/m365/viva/commands/engage/engage-message-add.js +0 -5
  43. package/dist/m365/viva/commands/engage/engage-message-get.js +0 -5
  44. package/dist/m365/viva/commands/engage/engage-message-like-set.js +0 -5
  45. package/dist/m365/viva/commands/engage/engage-message-list.js +0 -5
  46. package/dist/m365/viva/commands/engage/engage-message-remove.js +0 -5
  47. package/dist/m365/viva/commands/engage/engage-network-list.js +0 -5
  48. package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +0 -8
  49. package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +0 -8
  50. package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +0 -8
  51. package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +0 -8
  52. package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +0 -8
  53. package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +0 -8
  54. package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +0 -8
  55. package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +0 -8
  56. package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +0 -8
  57. package/dist/m365/viva/commands/engage/engage-search.js +0 -5
  58. package/dist/m365/viva/commands/engage/engage-user-get.js +0 -5
  59. package/dist/m365/viva/commands/engage/engage-user-list.js +0 -5
  60. package/dist/utils/drive.js +61 -0
  61. package/dist/utils/spo.js +106 -0
  62. package/docs/docs/cmd/app/permission/permission-add.mdx +5 -5
  63. package/docs/docs/cmd/cli/cli-consent.mdx +1 -1
  64. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +12 -12
  65. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +14 -14
  66. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +5 -5
  67. package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-remove.mdx +65 -0
  68. package/docs/docs/cmd/entra/group/group-add.mdx +0 -4
  69. package/docs/docs/cmd/entra/group/group-set.mdx +89 -0
  70. package/docs/docs/cmd/entra/group/group-user-list.mdx +7 -7
  71. package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +5 -5
  72. package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +3 -3
  73. package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +28 -10
  74. package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +1 -1
  75. package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +35 -11
  76. package/docs/docs/cmd/flow/flow-get.mdx +149 -283
  77. package/docs/docs/cmd/outlook/message/message-get.mdx +5 -5
  78. package/docs/docs/cmd/pa/app/app-export.mdx +15 -9
  79. package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +11 -12
  80. package/docs/docs/cmd/spo/app/app-uninstall.mdx +1 -1
  81. package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +6 -5
  82. package/docs/docs/cmd/spo/file/file-copy.mdx +119 -12
  83. package/docs/docs/cmd/spo/folder/folder-set.mdx +0 -6
  84. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +110 -0
  85. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +114 -0
  86. package/docs/docs/cmd/spo/list/list-get.mdx +6 -0
  87. package/docs/docs/cmd/spo/list/list-list.mdx +5 -7
  88. package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +11 -2
  89. package/docs/docs/cmd/spo/site/site-remove.mdx +0 -3
  90. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.mdx +2 -49
  91. package/docs/docs/cmd/teams/message/message-remove.mdx +2 -1
  92. package/docs/docs/cmd/teams/message/message-restore.mdx +62 -0
  93. package/npm-shrinkwrap.json +572 -478
  94. package/package.json +22 -23
  95. package/dist/m365/viva/commands/engage/yammerCommands.js +0 -25
@@ -9,7 +9,6 @@ import request from '../../../../request.js';
9
9
  import { formatting } from '../../../../utils/formatting.js';
10
10
  import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
11
11
  import commands from '../../commands.js';
12
- import yammerCommands from './yammerCommands.js';
13
12
  class VivaEngageSearchCommand extends VivaEngageCommand {
14
13
  get name() {
15
14
  return commands.ENGAGE_SEARCH;
@@ -17,9 +16,6 @@ class VivaEngageSearchCommand extends VivaEngageCommand {
17
16
  get description() {
18
17
  return 'Returns a list of messages, users, topics and groups that match the specified query.';
19
18
  }
20
- alias() {
21
- return [yammerCommands.SEARCH];
22
- }
23
19
  constructor() {
24
20
  super();
25
21
  _VivaEngageSearchCommand_instances.add(this);
@@ -93,7 +89,6 @@ class VivaEngageSearchCommand extends VivaEngageCommand {
93
89
  }
94
90
  }
95
91
  async commandAction(logger, args) {
96
- await this.showDeprecationWarning(logger, this.alias()[0], this.name);
97
92
  this.summary = {
98
93
  messages: 0,
99
94
  groups: 0,
@@ -8,7 +8,6 @@ import request from '../../../../request.js';
8
8
  import { formatting } from '../../../../utils/formatting.js';
9
9
  import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
10
10
  import commands from '../../commands.js';
11
- import yammerCommands from './yammerCommands.js';
12
11
  class VivaEngageUserGetCommand extends VivaEngageCommand {
13
12
  get name() {
14
13
  return commands.ENGAGE_USER_GET;
@@ -16,9 +15,6 @@ class VivaEngageUserGetCommand extends VivaEngageCommand {
16
15
  get description() {
17
16
  return 'Retrieves the current user or searches for a user by ID or e-mail';
18
17
  }
19
- alias() {
20
- return [yammerCommands.USER_GET];
21
- }
22
18
  defaultProperties() {
23
19
  return ['id', 'full_name', 'email', 'job_title', 'state', 'url'];
24
20
  }
@@ -30,7 +26,6 @@ class VivaEngageUserGetCommand extends VivaEngageCommand {
30
26
  __classPrivateFieldGet(this, _VivaEngageUserGetCommand_instances, "m", _VivaEngageUserGetCommand_initValidators).call(this);
31
27
  }
32
28
  async commandAction(logger, args) {
33
- await this.showDeprecationWarning(logger, this.alias()[0], this.name);
34
29
  let endPoint = `${this.resource}/v1/users/current.json`;
35
30
  if (args.options.id) {
36
31
  endPoint = `${this.resource}/v1/users/${args.options.id}.json`;
@@ -7,7 +7,6 @@ var _VivaEngageUserListCommand_instances, _VivaEngageUserListCommand_initTelemet
7
7
  import request from '../../../../request.js';
8
8
  import VivaEngageCommand from '../../../base/VivaEngageCommand.js';
9
9
  import commands from '../../commands.js';
10
- import yammerCommands from './yammerCommands.js';
11
10
  class VivaEngageUserListCommand extends VivaEngageCommand {
12
11
  get name() {
13
12
  return commands.ENGAGE_USER_LIST;
@@ -15,9 +14,6 @@ class VivaEngageUserListCommand extends VivaEngageCommand {
15
14
  get description() {
16
15
  return 'Returns users from the current network';
17
16
  }
18
- alias() {
19
- return [yammerCommands.USER_LIST];
20
- }
21
17
  defaultProperties() {
22
18
  return ['id', 'full_name', 'email'];
23
19
  }
@@ -92,7 +88,6 @@ class VivaEngageUserListCommand extends VivaEngageCommand {
92
88
  });
93
89
  }
94
90
  async commandAction(logger, args) {
95
- await this.showDeprecationWarning(logger, this.alias()[0], this.name);
96
91
  this.items = []; // this will reset the items array in interactive mode
97
92
  try {
98
93
  await this.getAllItems(logger, args, 1);
@@ -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
@@ -12,6 +12,16 @@ import { RoleType } from '../m365/spo/commands/roledefinition/RoleType.js';
12
12
  import { entraGroup } from './entraGroup.js';
13
13
  import { SharingCapabilities } from '../m365/spo/commands/site/SharingCapabilities.js';
14
14
  import { setTimeout } from 'timers/promises';
15
+ export var CreateCopyJobsNameConflictBehavior;
16
+ (function (CreateCopyJobsNameConflictBehavior) {
17
+ CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Fail"] = 0] = "Fail";
18
+ CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Replace"] = 1] = "Replace";
19
+ CreateCopyJobsNameConflictBehavior[CreateCopyJobsNameConflictBehavior["Rename"] = 2] = "Rename";
20
+ })(CreateCopyJobsNameConflictBehavior || (CreateCopyJobsNameConflictBehavior = {}));
21
+ // Wrapping this into a settings object so we can alter the values in tests
22
+ export const settings = {
23
+ pollingInterval: 3000
24
+ };
15
25
  export const spo = {
16
26
  async getRequestDigest(siteUrl) {
17
27
  const requestOptions = {
@@ -1405,6 +1415,38 @@ export const spo = {
1405
1415
  const site = await request.get(requestOptions);
1406
1416
  return site.id;
1407
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
+ },
1408
1450
  /**
1409
1451
  * Retrieves the ObjectIdentity from a SharePoint site
1410
1452
  * @param webUrl web url
@@ -1484,6 +1526,70 @@ export const spo = {
1484
1526
  };
1485
1527
  const itemsResponse = await request.get(requestOptionsItems);
1486
1528
  return (itemsResponse);
1529
+ },
1530
+ /**
1531
+ * Create a SharePoint copy job to copy a file/folder to another location.
1532
+ * @param webUrl Absolute web URL where the source file/folder is located.
1533
+ * @param sourceUrl Absolute URL of the source file/folder.
1534
+ * @param destinationUrl Absolute URL of the destination folder.
1535
+ * @param options Options for the copy job.
1536
+ * @returns Copy job information. Use {@link spo.getCopyJobResult} to get the result of the copy job.
1537
+ */
1538
+ async createCopyJob(webUrl, sourceUrl, destinationUrl, options) {
1539
+ const requestOptions = {
1540
+ url: `${webUrl}/_api/Site/CreateCopyJobs`,
1541
+ headers: {
1542
+ accept: 'application/json;odata=nometadata'
1543
+ },
1544
+ responseType: 'json',
1545
+ data: {
1546
+ destinationUri: destinationUrl,
1547
+ exportObjectUris: [sourceUrl],
1548
+ options: {
1549
+ NameConflictBehavior: options?.nameConflictBehavior ?? CreateCopyJobsNameConflictBehavior.Fail,
1550
+ AllowSchemaMismatch: true,
1551
+ BypassSharedLock: !!options?.bypassSharedLock,
1552
+ IgnoreVersionHistory: !!options?.ignoreVersionHistory,
1553
+ CustomizedItemName: options?.newName ? [options.newName] : undefined,
1554
+ SameWebCopyMoveOptimization: true
1555
+ }
1556
+ }
1557
+ };
1558
+ const response = await request.post(requestOptions);
1559
+ return response.value[0];
1560
+ },
1561
+ /**
1562
+ * Poll until the copy job is finished and return the result.
1563
+ * @param webUrl Absolute web URL where the copy job was created.
1564
+ * @param copyJobInfo Information about the copy job.
1565
+ * @throws Error if the copy job has failed.
1566
+ * @returns Information about the destination object.
1567
+ */
1568
+ async getCopyJobResult(webUrl, copyJobInfo) {
1569
+ const requestOptions = {
1570
+ url: `${webUrl}/_api/Site/GetCopyJobProgress`,
1571
+ headers: {
1572
+ accept: 'application/json;odata=nometadata'
1573
+ },
1574
+ responseType: 'json',
1575
+ data: {
1576
+ copyJobInfo: copyJobInfo
1577
+ }
1578
+ };
1579
+ let progress = await request.post(requestOptions);
1580
+ while (progress.JobState !== 0) {
1581
+ await setTimeout(settings.pollingInterval);
1582
+ progress = await request.post(requestOptions);
1583
+ }
1584
+ const logs = progress.Logs.map(l => JSON.parse(l));
1585
+ // Check if the job has failed
1586
+ const errorLog = logs.find(l => l.Event === 'JobError');
1587
+ if (errorLog) {
1588
+ throw new Error(errorLog.Message);
1589
+ }
1590
+ // Get the destination object information
1591
+ const objectInfo = logs.find(l => l.Event === 'JobFinishedObjectInfo');
1592
+ return objectInfo;
1487
1593
  }
1488
1594
  };
1489
1595
  //# sourceMappingURL=spo.js.map
@@ -16,10 +16,10 @@ m365 app permission add [options]
16
16
  `--appId [appId]`
17
17
  : Client ID of the Microsoft Entra app registered in the .m365rc.json file to retrieve API permissions for.
18
18
 
19
- `--applicationPermission [applicationPermission]`
19
+ `--applicationPermissions [applicationPermissions]`
20
20
  : Space-separated list of application permissions to add.
21
21
 
22
- `--delegatedPermission [delegatedPermission]`
22
+ `--delegatedPermissions [delegatedPermissions]`
23
23
  : Space-separated list of delegated permissions to add.
24
24
 
25
25
  `--grantAdminConsent`
@@ -37,19 +37,19 @@ If you have multiple apps registered in your .m365rc.json file, you can specify
37
37
  Adds the specified application permissions to the default app registered in the _.m365rc.json_ file while granting admin consent.
38
38
 
39
39
  ```sh
40
- m365 app permission add --applicationPermission 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --grantAdminConsent
40
+ m365 app permission add --applicationPermissions 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --grantAdminConsent
41
41
  ```
42
42
 
43
43
  Adds the specified delegated permissions to the default app registered in the _.m365rc.json_ file without granting admin consent.
44
44
 
45
45
  ```sh
46
- m365 app permission add --delegatedPermission 'https://graph.microsoft.com/offline_access'
46
+ m365 app permission add --delegatedPermissions 'https://graph.microsoft.com/offline_access'
47
47
  ```
48
48
 
49
49
  Adds the specified application and delegated permissions to a specific app registered in the _.m365rc.json_ file while granting admin consent.
50
50
 
51
51
  ```sh
52
- m365 app permission add --appId '1663767b-4172-4519-bfd1-28e6ff19055b' --applicationPermission 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --delegatedPermission 'https://graph.microsoft.com/offline_access' --grantAdminConsent
52
+ m365 app permission add --appId '1663767b-4172-4519-bfd1-28e6ff19055b' --applicationPermissions 'https://graph.microsoft.com/User.ReadWrite.All https://graph.microsoft.com/User.Read.All' --delegatedPermissions 'https://graph.microsoft.com/offline_access' --grantAdminConsent
53
53
  ```
54
54
 
55
55
  ## Response
@@ -16,7 +16,7 @@ m365 cli consent [options]
16
16
 
17
17
  ```md definition-list
18
18
  `-s, --service <service>`
19
- : Service for which to consent permissions. Allowed values: `VivaEngage`, (deprecated)`yammer`.
19
+ : Service for which to consent permissions. Allowed values: `VivaEngage`.
20
20
  ```
21
21
 
22
22
  <Global />
@@ -22,39 +22,39 @@ m365 entra sp add [options]
22
22
  ## Options
23
23
 
24
24
  ```md definition-list
25
- `--appId [appId]`
26
- : ID of the app for which the enterprise application should be created
25
+ `-i, --id [id]`
26
+ : ID of the app for which the enterprise application should be created.
27
27
 
28
- `--appName [appName]`
29
- : Display name of the app for which the enterprise application should be created
28
+ `-n, --displayName [displayName]`
29
+ : Display name of the app for which the enterprise application should be created.
30
30
 
31
31
  `--objectId [objectId]`
32
- : ObjectId of the app for which the enterprise application should be created
32
+ : ObjectId of the app for which the enterprise application should be created.
33
33
  ```
34
34
 
35
35
  <Global />
36
36
 
37
37
  ## Remarks
38
38
 
39
- Specify either the `appId`, `appName` or `objectId`. If you specify more than one option value, the command will fail with an error.
39
+ Specify either the `id`, `displayName` or `objectId`. If you specify more than one option value, the command will fail with an error.
40
40
 
41
41
  If you register an application in the portal, an application object as well as an enterprise application object are automatically created in your home tenant. If you register an application using CLI for Microsoft 365 or the Microsoft Graph, you'll need to create the enterprise application separately. To register/create an application using the CLI for Microsoft 365, use the [m365 entra app add](../app/app-add.mdx) command.
42
42
 
43
43
  ## Examples
44
44
 
45
- Creates an enterprise application for a registered Entra app with appId _b2307a39-e878-458b-bc90-03bc578531d6_.
45
+ Creates an enterprise application for a registered Entra app with the specified id.
46
46
 
47
47
  ```sh
48
- m365 entra enterpriseapp add --appId b2307a39-e878-458b-bc90-03bc578531d6
48
+ m365 entra enterpriseapp add --id b2307a39-e878-458b-bc90-03bc578531d6
49
49
  ```
50
50
 
51
- Creates an enterprise application for a registered Entra app with appName _Microsoft Graph_.
51
+ Creates an enterprise application for a registered Entra app with the specified displayName.
52
52
 
53
53
  ```sh
54
- m365 entra enterpriseapp add --appName "Microsoft Graph"
54
+ m365 entra enterpriseapp add --displayName "Microsoft Graph"
55
55
  ```
56
56
 
57
- Creates an enterprise application for a registered Entra app with objectId _b2307a39-e878-458b-bc90-03bc578531d6_.
57
+ Creates an enterprise application for a registered Entra app with the specified objectId.
58
58
 
59
59
  ```sh
60
60
  m365 entra enterpriseapp add --objectId b2307a39-e878-458b-bc90-03bc578531d6
@@ -172,7 +172,7 @@ m365 entra enterpriseapp add --objectId b2307a39-e878-458b-bc90-03bc578531d6
172
172
  <TabItem value="Markdown">
173
173
 
174
174
  ```md
175
- # entra enterpriseapp add --appId "8da75b6a-4272-4b17-8ee1-20ba66e2b06f"
175
+ # entra enterpriseapp add --id "8da75b6a-4272-4b17-8ee1-20ba66e2b06f"
176
176
 
177
177
  Date: 2023-06-02
178
178
 
@@ -22,40 +22,40 @@ m365 entra sp get [options]
22
22
  ## Options
23
23
 
24
24
  ```md definition-list
25
- `-i, --appId [appId]`
26
- : ID of the application for which the enterprise application should be retrieved
25
+ `-i, --id [id]`
26
+ : ID of the application for which the enterprise application should be retrieved.
27
27
 
28
- `-n, --appDisplayName [appDisplayName]`
29
- : Display name of the application for which the enterprise application should be retrieved
28
+ `-n, --displayName [displayName]`
29
+ : Display name of the application for which the enterprise application should be retrieved.
30
30
 
31
- `--appObjectId [appObjectId]`
32
- : ObjectId of the application for which the enterprise application should be retrieved
31
+ `--objectId [objectId]`
32
+ : ObjectId of the application for which the enterprise application should be retrieved.
33
33
  ```
34
34
 
35
35
  <Global />
36
36
 
37
37
  ## Remarks
38
38
 
39
- Specify either the `appId`, `appObjectId` or `appDisplayName`. If you specify more than one option value, the command will fail with an error.
39
+ Specify either the `id`, `objectId` or `displayName`. If you specify more than one option value, the command will fail with an error.
40
40
 
41
41
  ## Examples
42
42
 
43
- Return details about the enterprise application with appId _b2307a39-e878-458b-bc90-03bc578531d6_.
43
+ Return details about the enterprise application with the specified id.
44
44
 
45
45
  ```sh
46
- m365 entra enterpriseapp get --appId b2307a39-e878-458b-bc90-03bc578531d6
46
+ m365 entra enterpriseapp get --id b2307a39-e878-458b-bc90-03bc578531d6
47
47
  ```
48
48
 
49
- Return details about the _Microsoft Graph_ enterprise application.
49
+ Return details about the enterprise application with the specified displayName.
50
50
 
51
51
  ```sh
52
- m365 entra enterpriseapp get --appDisplayName "Microsoft Graph"
52
+ m365 entra enterpriseapp get --displayName "Microsoft Graph"
53
53
  ```
54
54
 
55
- Return details about the enterprise application with ObjectId _b2307a39-e878-458b-bc90-03bc578531dd_.
55
+ Return details about the enterprise application with the specified ObjectId.
56
56
 
57
57
  ```sh
58
- m365 entra enterpriseapp get --appObjectId b2307a39-e878-458b-bc90-03bc578531dd
58
+ m365 entra enterpriseapp get --objectId b2307a39-e878-458b-bc90-03bc578531dd
59
59
  ```
60
60
 
61
61
  ## Response
@@ -198,7 +198,7 @@ m365 entra enterpriseapp get --appObjectId b2307a39-e878-458b-bc90-03bc578531dd
198
198
  <TabItem value="Markdown">
199
199
 
200
200
  ```md
201
- # entra enterpriseapp get --appId "ac7c9b4b-83b0-4a5e-ace2-a3530162c8f8"
201
+ # entra enterpriseapp get --id "ac7c9b4b-83b0-4a5e-ace2-a3530162c8f8"
202
202
 
203
203
  Date: 2023-06-02
204
204
 
@@ -22,24 +22,24 @@ m365 entra sp list [options]
22
22
  ## Options
23
23
 
24
24
  ```md definition-list
25
- `--displayName [displayName]`
26
- : Returns only enterprise applications with the specified name
25
+ `-n, --displayName [displayName]`
26
+ : Returns only enterprise applications with the specified name.
27
27
 
28
28
  `--tag [tag]`
29
- : Returns only enterprise applications with the specified tag
29
+ : Returns only enterprise applications with the specified tag.
30
30
  ```
31
31
 
32
32
  <Global />
33
33
 
34
34
  ## Examples
35
35
 
36
- Return a list of all enterprise applications
36
+ Returns a list of all enterprise applications.
37
37
 
38
38
  ```sh
39
39
  m365 entra enterpriseapp list
40
40
  ```
41
41
 
42
- Return a list of all enterprise applications that comply with the display name and the tag parameters
42
+ Returns a list of all enterprise applications that comply with the specified display name and the tag parameters.
43
43
 
44
44
  ```sh
45
45
  m365 entra enterpriseapp list --displayName "My custom enterprise application" --tag "WindowsAzureActiveDirectoryIntegratedApp"
@@ -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.