@pnp/cli-microsoft365 9.1.0-beta.9a7d76f → 9.1.0-beta.a781c51

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 (80) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +6 -4
  4. package/dist/AuthServer.js +7 -7
  5. package/dist/api.js +1 -1
  6. package/dist/config.js +1 -0
  7. package/dist/m365/external/commands/item/item-add.js +2 -5
  8. package/dist/m365/file/commands/file-move.js +135 -0
  9. package/dist/m365/file/commands.js +2 -1
  10. package/dist/m365/spfx/commands/project/project-doctor/doctor-1.20.0.js +27 -0
  11. package/dist/m365/spfx/commands/project/project-doctor/rules/FN002021_DEVDEP_rushstack_eslint_config.js +10 -0
  12. package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
  13. package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0.js +59 -0
  14. package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
  15. package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
  16. package/dist/m365/spo/commands/page/page-remove.js +37 -16
  17. package/dist/m365/spo/commands/site/site-admin-list.js +8 -9
  18. package/dist/m365/spo/commands/site/site-admin-remove.js +194 -0
  19. package/dist/m365/spo/commands/site/site-sharingpermission-set.js +68 -0
  20. package/dist/m365/spo/commands.js +2 -0
  21. package/dist/m365/teams/MeetingTranscript.js +2 -0
  22. package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +152 -0
  23. package/dist/m365/teams/commands.js +1 -0
  24. package/dist/m365/viva/commands/engage/Community.js +2 -0
  25. package/dist/m365/viva/commands/engage/engage-community-list.js +28 -0
  26. package/dist/m365/viva/commands.js +1 -0
  27. package/dist/request.js +46 -61
  28. package/dist/utils/driveUtil.js +51 -0
  29. package/dist/utils/spo.js +5 -7
  30. package/dist/utils/timersUtil.js +12 -0
  31. package/dist/utils/urlUtil.js +8 -0
  32. package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +2 -2
  33. package/docs/docs/cmd/external/item/item-add.mdx +3 -3
  34. package/docs/docs/cmd/file/file-move.mdx +79 -0
  35. package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
  36. package/docs/docs/cmd/spo/cdn/cdn-get.mdx +1 -1
  37. package/docs/docs/cmd/spo/cdn/cdn-origin-add.mdx +1 -1
  38. package/docs/docs/cmd/spo/cdn/cdn-origin-list.mdx +1 -1
  39. package/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +1 -1
  40. package/docs/docs/cmd/spo/cdn/cdn-policy-list.mdx +1 -1
  41. package/docs/docs/cmd/spo/cdn/cdn-policy-set.mdx +1 -1
  42. package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +1 -1
  43. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.mdx +1 -1
  44. package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.mdx +1 -1
  45. package/docs/docs/cmd/spo/homesite/homesite-remove.mdx +1 -1
  46. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.mdx +1 -1
  47. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx +1 -1
  48. package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.mdx +1 -1
  49. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +1 -1
  50. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +1 -1
  51. package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx +1 -1
  52. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.mdx +1 -1
  53. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx +1 -1
  54. package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.mdx +1 -1
  55. package/docs/docs/cmd/spo/page/page-remove.mdx +30 -12
  56. package/docs/docs/cmd/spo/site/site-admin-add.mdx +2 -2
  57. package/docs/docs/cmd/spo/site/site-admin-list.mdx +64 -12
  58. package/docs/docs/cmd/spo/site/site-admin-remove.mdx +67 -0
  59. package/docs/docs/cmd/spo/site/site-appcatalog-add.mdx +1 -1
  60. package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +1 -1
  61. package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +1 -1
  62. package/docs/docs/cmd/spo/site/site-list.mdx +6 -4
  63. package/docs/docs/cmd/spo/site/site-set.mdx +1 -1
  64. package/docs/docs/cmd/spo/site/site-sharingpermission-set.mdx +58 -0
  65. package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +1 -1
  66. package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +1 -1
  67. package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.mdx +1 -1
  68. package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.mdx +1 -1
  69. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.mdx +1 -1
  70. package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx +1 -1
  71. package/docs/docs/cmd/spo/tenant/tenant-settings-list.mdx +1 -1
  72. package/docs/docs/cmd/spo/theme/theme-apply.mdx +1 -1
  73. package/docs/docs/cmd/spo/theme/theme-get.mdx +1 -1
  74. package/docs/docs/cmd/spo/theme/theme-list.mdx +1 -1
  75. package/docs/docs/cmd/spo/theme/theme-remove.mdx +1 -1
  76. package/docs/docs/cmd/spo/theme/theme-set.mdx +1 -1
  77. package/docs/docs/cmd/spp/contentcenter/contentcenter-list.mdx +3 -5
  78. package/docs/docs/cmd/teams/meeting/meeting-transcript-get.mdx +132 -0
  79. package/docs/docs/cmd/viva/engage/engage-community-list.mdx +81 -0
  80. package/package.json +1 -1
@@ -0,0 +1,51 @@
1
+ import request from "../request.js";
2
+ export const driveUtil = {
3
+ /**
4
+ * Retrieves the Drive associated with the specified site and URL.
5
+ * @param siteId Site ID
6
+ * @param url Drive URL
7
+ * @returns The Drive associated with the drive URL.
8
+ */
9
+ async getDriveByUrl(siteId, url) {
10
+ const requestOptions = {
11
+ url: `https://graph.microsoft.com/v1.0/sites/${siteId}/drives?$select=webUrl,id`,
12
+ headers: {
13
+ accept: 'application/json;odata.metadata=none'
14
+ },
15
+ responseType: 'json'
16
+ };
17
+ const drives = await request.get(requestOptions);
18
+ const lowerCaseFolderUrl = url.href.toLowerCase();
19
+ const drive = drives.value
20
+ .sort((a, b) => b.webUrl.localeCompare(a.webUrl))
21
+ .find((d) => {
22
+ const driveUrl = d.webUrl.toLowerCase();
23
+ return lowerCaseFolderUrl.startsWith(driveUrl) &&
24
+ (driveUrl.length === lowerCaseFolderUrl.length ||
25
+ lowerCaseFolderUrl[driveUrl.length] === '/');
26
+ });
27
+ if (!drive) {
28
+ throw `Drive '${url.href}' not found`;
29
+ }
30
+ return drive;
31
+ },
32
+ /**
33
+ * Retrieves the ID of a drive item (file, folder, etc.) associated with the given drive and item URL.
34
+ * @param drive The Drive object containing the item
35
+ * @param itemUrl Item URL
36
+ * @returns Drive item ID
37
+ */
38
+ async getDriveItemId(drive, itemUrl) {
39
+ const relativeItemUrl = itemUrl.href.replace(new RegExp(`${drive.webUrl}`, 'i'), '').replace(/\/+$/, '');
40
+ const requestOptions = {
41
+ url: `https://graph.microsoft.com/v1.0/drives/${drive.id}/root${relativeItemUrl ? `:${relativeItemUrl}` : ''}?$select=id`,
42
+ headers: {
43
+ accept: 'application/json;odata.metadata=none'
44
+ },
45
+ responseType: 'json'
46
+ };
47
+ const driveItem = await request.get(requestOptions);
48
+ return driveItem?.id;
49
+ }
50
+ };
51
+ //# sourceMappingURL=driveUtil.js.map
package/dist/utils/spo.js CHANGED
@@ -1541,7 +1541,7 @@ export const spo = {
1541
1541
  return file;
1542
1542
  },
1543
1543
  /**
1544
- * Gets the site collection URL for a given web URL using SP Admin site.
1544
+ * Gets the primary owner login from a site as admin.
1545
1545
  * @param adminUrl The SharePoint admin URL
1546
1546
  * @param siteId The site ID
1547
1547
  * @param logger The logger object
@@ -1555,13 +1555,12 @@ export const spo = {
1555
1555
  const requestOptions = {
1556
1556
  url: `${adminUrl}/_api/SPO.Tenant/sites('${siteId}')?$select=OwnerLoginName`,
1557
1557
  headers: {
1558
- accept: 'application/json;odata=nometadata',
1559
- 'content-type': 'application/json;charset=utf-8'
1560
- }
1558
+ accept: 'application/json;odata=nometadata'
1559
+ },
1560
+ responseType: 'json'
1561
1561
  };
1562
1562
  const response = await request.get(requestOptions);
1563
- const responseContent = JSON.parse(response);
1564
- return responseContent.OwnerLoginName;
1563
+ return response.OwnerLoginName;
1565
1564
  },
1566
1565
  /**
1567
1566
  * Gets the primary owner login from a site.
@@ -1576,7 +1575,6 @@ export const spo = {
1576
1575
  }
1577
1576
  const requestOptions = {
1578
1577
  url: `${siteUrl}/_api/site/owner`,
1579
- method: 'GET',
1580
1578
  headers: {
1581
1579
  'accept': 'application/json;odata=nometadata'
1582
1580
  },
@@ -0,0 +1,12 @@
1
+ import { setTimeout } from "timers/promises";
2
+ export const timersUtil = {
3
+ /**
4
+ * Timeout for a specific duration.
5
+ * @param duration Duration in milliseconds.
6
+ */
7
+ /* c8 ignore next 3 */
8
+ async setTimeout(duration) {
9
+ return setTimeout(duration);
10
+ }
11
+ };
12
+ //# sourceMappingURL=timersUtil.js.map
@@ -198,6 +198,14 @@ export const urlUtil = {
198
198
  return rootUrl.origin;
199
199
  }
200
200
  },
201
+ /**
202
+ * Removes leading slashes from the URL.
203
+ * @param url The URL to process.
204
+ * @returns The URL without leading slashes.
205
+ */
206
+ removeLeadingSlashes(url) {
207
+ return url.replace(/^\/+/, '');
208
+ },
201
209
  /**
202
210
  * Removes trailing slashes from the URL.
203
211
  * @param url The URL to process.
@@ -9,13 +9,13 @@ Get the total storage used across all group mailboxes and group sites
9
9
  ## Usage
10
10
 
11
11
  ```sh
12
- m365 entra m365group report activitystorage [options]
12
+ m365 entra m365group report activitystorage [options]
13
13
  ```
14
14
 
15
15
  ## Alias
16
16
 
17
17
  ```sh
18
- m365 aad m365group report activitystorage [options]
18
+ m365 aad m365group report activitystorage [options]
19
19
  ```
20
20
 
21
21
  ## Options
@@ -63,13 +63,13 @@ For more information about using these options, see the Microsoft Graph API docu
63
63
  Creates an external item with simple properties that everyone is allowed to access
64
64
 
65
65
  ```sh
66
- m365 external item add --id "pnp-ensure-siteassets-library" --connectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors "Phil Harding" --acls "grant,everyone,everyone"
66
+ m365 external item add --id "pnp-ensure-siteassets-library" --externalConnectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors "Phil Harding" --acls "grant,everyone,everyone"
67
67
  ```
68
68
 
69
69
  Creates an external item with multi-value properties accessible only to users from the specified Entra group
70
70
 
71
71
  ```sh
72
- m365 external item add --id "pnp-ensure-siteassets-library" --connectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors@odata.type "Collection(String)" --authors "Phil Harding;#Steve Smith" --acls "grant,group,Super users"
72
+ m365 external item add --id "pnp-ensure-siteassets-library" --externalConnectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors@odata.type "Collection(String)" --authors "Phil Harding;#Steve Smith" --acls "grant,group,Super users"
73
73
  ```
74
74
 
75
75
  ## Response
@@ -123,7 +123,7 @@ m365 external item add --id "pnp-ensure-siteassets-library" --connectionId "samp
123
123
  <TabItem value="Markdown">
124
124
 
125
125
  ```md
126
- # m365 external item add --id "pnp-ensure-siteassets-library" --connectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors "Phil Harding" --acls "grant,everyone,everyone"
126
+ # m365 external item add --id "pnp-ensure-siteassets-library" --externalConnectionId "samplesolutiongallery" --content "Ensure that the Site Assets library is created." --title "Ensure the Site Assets Library is created" --description "Ensure that the Site Assets library is created." --authors "Phil Harding" --acls "grant,everyone,everyone"
127
127
 
128
128
  Date: 2023-10-28
129
129
 
@@ -0,0 +1,79 @@
1
+ import Global from '/docs/cmd/_global.mdx';
2
+
3
+ # file move
4
+
5
+ Moves a file to another location using the Microsoft Graph
6
+
7
+ ## Usage
8
+
9
+ ```sh
10
+ m365 file move [options]
11
+ ```
12
+
13
+ ## Options
14
+
15
+ ```md definition-list
16
+ `-u, --webUrl <webUrl>`
17
+ : The URL of the site where the file is located.
18
+
19
+ `-s, --sourceUrl <sourceUrl>`
20
+ : Server-relative or absolute URL of the file.
21
+
22
+ `-t, --targetUrl <targetUrl>`
23
+ : Server-relative or absolute URL of the location.
24
+
25
+ `--newName [newName]`
26
+ : New name of the destination file.
27
+
28
+ `--nameConflictBehavior [nameConflictBehavior]`
29
+ : Behavior when a document with the same name is already present at the destination. Possible values: `fail`, `replace`, `rename`. Default is `fail`.
30
+ ```
31
+
32
+ <Global />
33
+
34
+ ## Remarks
35
+
36
+ - If the source and target locations are within the same document library or drive, the command will utilize the Move DriveItem API, preserving the version history of the file.
37
+ - If the source and target locations are in different document libraries or drives, the command will use a copy-and-delete combination to move the file. Please note that in this case, version history will not be retained.
38
+
39
+ ## Examples
40
+
41
+ Move a file by server-relative URL to a folder in the same document library
42
+
43
+ ```sh
44
+ m365 file move --webUrl "https://contoso.sharepoint.com/sites/project" --sourceUrl "/sites/project/Shared Documents/Document.pdf" --targetUrl "/sites/project/Shared Documents/NewFolder"
45
+ ```
46
+
47
+ Move a file by server-relative URL to a document library in another site collection with server relative URL
48
+
49
+ ```sh
50
+ m365 file move --webUrl "https://contoso.sharepoint.com/sites/project" --sourceUrl "/sites/project/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents"
51
+ ```
52
+
53
+ Move a file by absolute URL to a document library in another site collection with absolute URL
54
+
55
+ ```sh
56
+ m365 file move --webUrl "https://contoso.sharepoint.com" --sourceUrl "https://contoso.sharepoint.com/Shared Documents/Document.pdf" --targetUrl "https://contoso.sharepoint.com/sites/IT/Shared Documents"
57
+ ```
58
+
59
+ Move a file to a document library in another site collection and rename the file
60
+
61
+ ```sh
62
+ m365 file move --webUrl "https://contoso.sharepoint.com" --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents" --newName "newName"
63
+ ```
64
+
65
+ Move a file to a document library in another site collection and rename the file if a file with the same name already exists.
66
+
67
+ ```sh
68
+ m365 file move --webUrl "https://contoso.sharepoint.com" --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents" --nameConflictBehavior rename
69
+ ```
70
+
71
+ Move a file to Onedrive for business
72
+
73
+ ```sh
74
+ m365 file move --webUrl "https://contoso.sharepoint.com" --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "https://contoso-my.sharepoint.com/personal/john_contoso_onmicrosoft_com/documents"
75
+ ```
76
+
77
+ ## Response
78
+
79
+ The command won't return a response on success.
@@ -35,7 +35,7 @@ m365 spfx project upgrade [options]
35
35
 
36
36
  ## Remarks
37
37
 
38
- The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.19.0).
38
+ The `spfx project upgrade` command helps you upgrade your SharePoint Framework project to the specified version. If no version is specified, the command will upgrade to the latest version of the SharePoint Framework it supports (v1.20.0).
39
39
 
40
40
  This command doesn't change your project files. Instead, it gives you a report with all steps necessary to upgrade your project to the specified version of the SharePoint Framework. Changing project files is error-prone, especially when it comes to updating your solution's code. This is why at this moment, this command produces a report that you can use yourself to perform the necessary updates and verify that everything is working as expected.
41
41
 
@@ -27,7 +27,7 @@ Using the `-t, --type` option you can choose whether you want to manage the sett
27
27
 
28
28
  :::info
29
29
 
30
- To use this command you have to have permissions to access the tenant admin site.
30
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
31
31
 
32
32
  :::
33
33
 
@@ -28,7 +28,7 @@ Using the `-t, --type` option you can choose whether you want to manage the sett
28
28
 
29
29
  :::info
30
30
 
31
- To use this command you have to have permissions to access the tenant admin site.
31
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
32
32
 
33
33
  :::
34
34
 
@@ -27,7 +27,7 @@ Using the `-t, --type` option you can choose whether you want to manage the sett
27
27
 
28
28
  :::info
29
29
 
30
- To use this command you have to have permissions to access the tenant admin site.
30
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
31
31
 
32
32
  :::
33
33
 
@@ -31,7 +31,7 @@ Using the `-t, --type` option you can choose whether you want to manage the sett
31
31
 
32
32
  :::info
33
33
 
34
- To use this command you have to have permissions to access the tenant admin site.
34
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
35
35
 
36
36
  :::
37
37
 
@@ -27,7 +27,7 @@ Using the `-t, --cdnType` option you can choose whether you want to manage the s
27
27
 
28
28
  :::info
29
29
 
30
- To use this command you have to have permissions to access the tenant admin site.
30
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
31
31
 
32
32
  :::
33
33
 
@@ -31,7 +31,7 @@ Using the `-t, --cdnType` option you can choose whether you want to manage the s
31
31
 
32
32
  :::info
33
33
 
34
- To use this command you have to have permissions to access the tenant admin site.
34
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
35
35
 
36
36
  :::
37
37
 
@@ -37,7 +37,7 @@ m365 spo externaluser list [options]
37
37
 
38
38
  :::info
39
39
 
40
- To use this command you have to have permissions to access the tenant admin site.
40
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
41
41
 
42
42
  :::
43
43
 
@@ -20,7 +20,7 @@ m365 spo hidedefaultthemes get [options]
20
20
 
21
21
  :::info
22
22
 
23
- To use this command you have to have permissions to access the tenant admin site.
23
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
24
24
 
25
25
  :::
26
26
 
@@ -23,7 +23,7 @@ m365 spo hidedefaultthemes set [options]
23
23
 
24
24
  :::info
25
25
 
26
- To use this command you have to have permissions to access the tenant admin site.
26
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
27
27
 
28
28
  :::
29
29
 
@@ -25,7 +25,7 @@ m365 spo homesite remove [options]
25
25
 
26
26
  :::info
27
27
 
28
- To use this command you have to have permissions to access the tenant admin site.
28
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
29
29
 
30
30
  :::
31
31
 
@@ -20,7 +20,7 @@ m365 spo knowledgehub get [options]
20
20
 
21
21
  :::info
22
22
 
23
- To use this command you have to have permissions to access the tenant admin site.
23
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
24
24
 
25
25
  :::
26
26
 
@@ -25,7 +25,7 @@ m365 spo knowledgehub remove [options]
25
25
 
26
26
  :::info
27
27
 
28
- To use this command you have to have permissions to access the tenant admin site.
28
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
29
29
 
30
30
  :::
31
31
 
@@ -27,7 +27,7 @@ If the specified url doesn't refer to an existing site collection, you will get
27
27
 
28
28
  :::info
29
29
 
30
- To use this command you have to have permissions to access the tenant admin site.
30
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
31
31
 
32
32
  :::
33
33
 
@@ -32,7 +32,7 @@ m365 spo orgassetslibrary add [options]
32
32
 
33
33
  :::info
34
34
 
35
- To use this command you have to have permissions to access the tenant admin site.
35
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
36
36
 
37
37
  :::
38
38
 
@@ -20,7 +20,7 @@ m365 spo orgassetslibrary list [options]
20
20
 
21
21
  :::info
22
22
 
23
- To use this command you have to have permissions to access the tenant admin site.
23
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
24
24
 
25
25
  :::
26
26
 
@@ -28,7 +28,7 @@ m365 spo orgassetslibrary remove [options]
28
28
 
29
29
  :::info
30
30
 
31
- To use this command you have to have permissions to access the tenant admin site.
31
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
32
32
 
33
33
  :::
34
34
 
@@ -20,7 +20,7 @@ m365 spo orgnewssite list [options]
20
20
 
21
21
  :::info
22
22
 
23
- To use this command you have to have permissions to access the tenant admin site.
23
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
24
24
 
25
25
  :::
26
26
 
@@ -26,7 +26,7 @@ m365 spo orgnewssite remove [options]
26
26
 
27
27
  :::info
28
28
 
29
- To use this command you have to have permissions to access the tenant admin site.
29
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
30
30
 
31
31
  :::
32
32
 
@@ -25,7 +25,7 @@ Using the `-u, --url` option you can specify which site to add to the list of or
25
25
 
26
26
  :::info
27
27
 
28
- To use this command you have to have permissions to access the tenant admin site.
28
+ To use this command you must be either **SharePoint Administrator** or **Global Administrator**.
29
29
 
30
30
  :::
31
31
 
@@ -13,36 +13,54 @@ m365 spo page remove [options]
13
13
  ## Options
14
14
 
15
15
  ```md definition-list
16
+ `-u, --webUrl <webUrl>`
17
+ : URL of the site where the page is located.
18
+
16
19
  `-n, --name <name>`
17
- : Name of the page to remove.
20
+ : Name of the page.
18
21
 
19
- `-u, --webUrl <webUrl>`
20
- : URL of the site from which the page should be removed.
22
+ `--recycle`
23
+ : Send the page to the recycle bin instead of permanently deleting it.
24
+
25
+ `--bypassSharedLock`
26
+ : Remove the page even if it is locked for shared use.
21
27
 
22
28
  `-f, --force`
23
- : Do not prompt for confirmation before removing the page.
29
+ : Do not prompt for confirmation.
24
30
  ```
25
31
 
26
32
  <Global />
27
33
 
28
- ## Remarks
29
-
30
- If you try to remove a page with that does not exist, you will get a `The file does not exist` error.
31
-
32
- If you set the `-f, --force` flag, you will not be prompted for confirmation before the page is actually removed.
33
-
34
34
  ## Examples
35
35
 
36
36
  Remove a modern page
37
37
 
38
38
  ```sh
39
- m365 spo page remove --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team
39
+ m365 spo page remove --name HR.aspx --webUrl https://contoso.sharepoint.com/sites/Marketing
40
40
  ```
41
41
 
42
42
  Remove a modern page without a confirmation prompt
43
43
 
44
44
  ```sh
45
- m365 spo page remove --name page.aspx --webUrl https://contoso.sharepoint.com/sites/a-team --force
45
+ m365 spo page remove --name HR.aspx --webUrl https://contoso.sharepoint.com/sites/Marketing --force
46
+ ```
47
+
48
+ Send a page to the recycle bin
49
+
50
+ ```sh
51
+ m365 spo page remove --name HR.aspx --webUrl https://contoso.sharepoint.com/sites/Marketing --recycle
52
+ ```
53
+
54
+ Remove a page that is locked
55
+
56
+ ```sh
57
+ m365 spo page remove --name HR.aspx --webUrl https://contoso.sharepoint.com/sites/Marketing --bypassSharedLock
58
+ ```
59
+
60
+ Remove a page that is located in a subfolder
61
+
62
+ ```sh
63
+ m365 spo page remove --name /Departments/People/HR.aspx --webUrl https://contoso.sharepoint.com/sites/Marketing
46
64
  ```
47
65
 
48
66
  ## Response
@@ -9,7 +9,7 @@ Adds a user or group as a site collection administrator
9
9
  ## Usage
10
10
 
11
11
  ```sh
12
- m365 spo site admin add [options]
12
+ m365 spo site admin add [options]
13
13
  ```
14
14
 
15
15
  ## Options
@@ -64,4 +64,4 @@ m365 spo site admin add --siteUrl https://contoso.sharepoint.com --groupName SP_
64
64
  ```
65
65
  ## Response
66
66
 
67
- The command won't return a response on success.
67
+ The command won't return a response on success.
@@ -28,12 +28,10 @@ m365 spo site admin list [options]
28
28
 
29
29
  :::info
30
30
 
31
- To use this command with the `--asAdmin` mode, you must have permission to access the tenant admin site.
31
+ To use this command with the `--asAdmin` mode, you must be at least SharePoint administrator.
32
32
 
33
33
  Without this parameter, you must have site collection admin permissions for the requested site.
34
34
 
35
- In `--asAdmin` mode, the Id, PrincipalType, and PrincipalTypeString properties are not exported.
36
-
37
35
  :::
38
36
 
39
37
  ## Examples
@@ -52,6 +50,8 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
52
50
 
53
51
  ## Response
54
52
 
53
+ ### Standard response
54
+
55
55
  <Tabs>
56
56
  <TabItem value="JSON">
57
57
 
@@ -73,13 +73,9 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
73
73
  <TabItem value="Text">
74
74
 
75
75
  ```text
76
- Email : user@contoso.com
77
- Id : 6
78
- LoginName : i:0#.f|membership|user@contoso.com
79
- PrincipalType : 1
80
- PrincipalTypeString : User
81
- Title : User Example
82
- IsPrimaryAdmin : true
76
+ Id LoginName Title PrincipalTypeString
77
+ -- --------------------------------------------------------------------------- ------- -------------------
78
+ 15 c:0o.c|federateddirectoryclaimprovider|d8430798-5a00-00ba-83b0-dd7a032d549a Members SecurityGroup
83
79
  ```
84
80
 
85
81
  </TabItem>
@@ -98,7 +94,7 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
98
94
 
99
95
  Date: 20/03/2024
100
96
 
101
- ## User
97
+ ## User Example
102
98
 
103
99
  Property | Value
104
100
  ---------|-------
@@ -112,4 +108,60 @@ m365 spo site admin list --siteUrl https://contoso.sharepoint.com --asAdmin
112
108
  ```
113
109
 
114
110
  </TabItem>
115
- </Tabs>
111
+ </Tabs>
112
+
113
+ ### `asAdmin` response
114
+
115
+ When we make use of the option `asAdmin` the response will differ.
116
+
117
+ <Tabs>
118
+ <TabItem value="JSON">
119
+
120
+ ```json
121
+ [
122
+ {
123
+ "Email": "user@contoso.com",
124
+ "LoginName": "i:0#.f|membership|user@contoso.com",
125
+ "Title": "User Example",
126
+ "IsPrimaryAdmin": true
127
+ }
128
+ ]
129
+ ```
130
+
131
+ </TabItem>
132
+ <TabItem value="Text">
133
+
134
+ ```text
135
+ LoginName Title
136
+ --------------------------------------------------------------------------- ---------------
137
+ c:0o.c|federateddirectoryclaimprovider|d8430798-5a00-00ba-83b0-dd7a032d549a Members
138
+ ```
139
+
140
+ </TabItem>
141
+ <TabItem value="CSV">
142
+
143
+ ```csv
144
+ Email,LoginName,Title,IsPrimaryAdmin
145
+ user@contoso.com,i:0#.f|membership|user@contoso.com,User Example,1
146
+ ```
147
+
148
+ </TabItem>
149
+ <TabItem value="Markdown">
150
+
151
+ ```md
152
+ # spo site admin list --siteUrl "https://contoso.sharepoint.com/sites/Test" --asAdmin
153
+
154
+ Date: 20/03/2024
155
+
156
+ ## User Example
157
+
158
+ Property | Value
159
+ ---------|-------
160
+ Email | user@contoso.com
161
+ LoginName | i:0#.f\|membership\|user@contoso.com
162
+ Title | User Example
163
+ IsPrimaryAdmin | true
164
+ ```
165
+
166
+ </TabItem>
167
+ </Tabs>