@pnp/cli-microsoft365 7.4.0 → 7.5.0-beta.0ae7da4
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.
- package/.devcontainer/Dockerfile +2 -2
- package/Dockerfile +2 -5
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/app/commands/app-get.js +2 -2
- package/dist/m365/entra/aadCommands.js +1 -0
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +2 -2
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-add.js +8 -8
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-get.js +2 -2
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-list.js +2 -2
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +2 -2
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-roleassignment-add.js +4 -4
- package/dist/m365/entra/commands/app/app-permission-add.js +3 -7
- package/dist/m365/entra/commands/app/app-permission-list.js +182 -0
- package/dist/m365/entra/commands/group/group-add.js +224 -0
- package/dist/m365/entra/commands/group/group-get.js +3 -3
- package/dist/m365/entra/commands/group/group-remove.js +2 -2
- package/dist/m365/entra/commands/group/group-user-add.js +145 -0
- package/dist/m365/entra/commands/group/group-user-list.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-get.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-remove.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-renew.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-set.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-user-remove.js +2 -2
- package/dist/m365/entra/commands/m365group/m365group-user-set.js +2 -2
- package/dist/m365/entra/commands/user/user-get.js +38 -38
- package/dist/m365/entra/commands.js +3 -0
- package/dist/m365/external/commands/connection/connection-doctor.js +2 -1
- package/dist/m365/file/commands/file-copy.js +151 -0
- package/dist/m365/file/commands.js +1 -0
- package/dist/m365/flow/commands/owner/owner-ensure.js +4 -4
- package/dist/m365/flow/commands/owner/owner-remove.js +4 -4
- package/dist/m365/onenote/commands/notebook/notebook-list.js +2 -2
- package/dist/m365/onenote/commands/page/page-list.js +2 -2
- package/dist/m365/pa/commands/app/app-owner-set.js +2 -2
- package/dist/m365/pa/commands/app/app-permission-ensure.js +4 -4
- package/dist/m365/pa/commands/app/app-permission-remove.js +4 -4
- package/dist/m365/planner/commands/bucket/bucket-add.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-get.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-list.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-remove.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-set.js +2 -2
- package/dist/m365/planner/commands/plan/plan-add.js +2 -2
- package/dist/m365/planner/commands/plan/plan-get.js +2 -2
- package/dist/m365/planner/commands/plan/plan-list.js +2 -2
- package/dist/m365/planner/commands/plan/plan-remove.js +2 -2
- package/dist/m365/planner/commands/plan/plan-set.js +2 -2
- package/dist/m365/planner/commands/roster/roster-member-add.js +2 -2
- package/dist/m365/planner/commands/roster/roster-member-get.js +2 -2
- package/dist/m365/planner/commands/roster/roster-member-remove.js +2 -2
- package/dist/m365/planner/commands/task/task-add.js +2 -2
- package/dist/m365/planner/commands/task/task-get.js +2 -2
- package/dist/m365/planner/commands/task/task-list.js +2 -2
- package/dist/m365/planner/commands/task/task-remove.js +2 -2
- package/dist/m365/planner/commands/task/task-set.js +2 -2
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +1 -1
- package/dist/m365/spo/commands/group/group-member-add.js +4 -4
- package/dist/m365/spo/commands/group/group-member-remove.js +2 -2
- package/dist/m365/spo/commands/group/group-set.js +2 -2
- package/dist/m365/spo/commands/site/site-remove.js +2 -2
- package/dist/m365/spo/commands/site/site-set.js +2 -2
- package/dist/m365/spo/commands/user/user-ensure.js +2 -2
- package/dist/m365/teams/commands/app/app-install.js +2 -2
- package/dist/m365/teams/commands/channel/channel-get.js +2 -2
- package/dist/m365/teams/commands/channel/channel-list.js +2 -2
- package/dist/m365/teams/commands/channel/channel-member-add.js +2 -2
- package/dist/m365/teams/commands/channel/channel-member-list.js +2 -2
- package/dist/m365/teams/commands/channel/channel-member-remove.js +2 -2
- package/dist/m365/teams/commands/channel/channel-member-set.js +2 -2
- package/dist/m365/teams/commands/channel/channel-remove.js +2 -2
- package/dist/m365/teams/commands/channel/channel-set.js +2 -2
- package/dist/m365/teams/commands/meeting/meeting-add.js +2 -2
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +2 -2
- package/dist/m365/teams/commands/meeting/meeting-get.js +3 -3
- package/dist/m365/teams/commands/meeting/meeting-list.js +2 -2
- package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +2 -2
- package/dist/m365/teams/commands/tab/tab-get.js +2 -2
- package/dist/m365/teams/commands/team/team-add.js +6 -6
- package/dist/m365/teams/commands/team/team-archive.js +2 -2
- package/dist/m365/teams/commands/team/team-get.js +2 -2
- package/dist/m365/teams/commands/team/team-remove.js +2 -2
- package/dist/m365/teams/commands/team/team-unarchive.js +2 -2
- package/dist/utils/{aadAdministrativeUnit.js → entraAdministrativeUnit.js} +2 -2
- package/dist/utils/{aadDevice.js → entraDevice.js} +2 -2
- package/dist/utils/{aadGroup.js → entraGroup.js} +2 -2
- package/dist/utils/{aadUser.js → entraUser.js} +38 -2
- package/dist/utils/spo.js +24 -2
- package/dist/utils/urlUtil.js +31 -0
- package/dist/utils/validation.js +8 -0
- package/docs/docs/cmd/entra/app/app-permission-add.mdx +2 -2
- package/docs/docs/cmd/entra/app/app-permission-list.mdx +105 -0
- package/docs/docs/cmd/entra/group/group-add.mdx +231 -0
- package/docs/docs/cmd/entra/group/group-user-add.mdx +62 -0
- package/docs/docs/cmd/file/file-copy.mdx +68 -0
- package/docs/docs/cmd/spo/listitem/listitem-list.mdx +1 -1
- package/npm-shrinkwrap.json +170 -168
- package/package.json +19 -19
|
@@ -3,7 +3,7 @@ import { formatting } from "./formatting.js";
|
|
|
3
3
|
import { odata } from "./odata.js";
|
|
4
4
|
import { cli } from '../cli/cli.js';
|
|
5
5
|
const graphResource = 'https://graph.microsoft.com';
|
|
6
|
-
export const
|
|
6
|
+
export const entraGroup = {
|
|
7
7
|
/**
|
|
8
8
|
* Retrieve a single group.
|
|
9
9
|
* @param id Group ID.
|
|
@@ -95,4 +95,4 @@ export const aadGroup = {
|
|
|
95
95
|
return group.groupTypes.some(type => type === 'Unified');
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
|
-
//# sourceMappingURL=
|
|
98
|
+
//# sourceMappingURL=entraGroup.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import request from "../request.js";
|
|
2
2
|
import { formatting } from "./formatting.js";
|
|
3
3
|
const graphResource = 'https://graph.microsoft.com';
|
|
4
|
-
export const
|
|
4
|
+
export const entraUser = {
|
|
5
5
|
/**
|
|
6
6
|
* Retrieve the id of a user by its UPN.
|
|
7
7
|
* @param upn User UPN.
|
|
@@ -20,6 +20,42 @@ export const aadUser = {
|
|
|
20
20
|
}
|
|
21
21
|
return res.value[0].id;
|
|
22
22
|
},
|
|
23
|
+
/**
|
|
24
|
+
* Retrieve the IDs of users by their UPNs. There is no guarantee that the order of the returned IDs will match the order of the specified UPNs.
|
|
25
|
+
* @param upns Array of user UPNs.
|
|
26
|
+
* @returns Array of user IDs.
|
|
27
|
+
*/
|
|
28
|
+
async getUserIdsByUpns(upns) {
|
|
29
|
+
const userIds = [];
|
|
30
|
+
for (let i = 0; i < upns.length; i += 20) {
|
|
31
|
+
const upnsChunk = upns.slice(i, i + 20);
|
|
32
|
+
const requestOptions = {
|
|
33
|
+
url: `${graphResource}/v1.0/$batch`,
|
|
34
|
+
headers: {
|
|
35
|
+
accept: 'application/json;odata.metadata=none'
|
|
36
|
+
},
|
|
37
|
+
responseType: 'json',
|
|
38
|
+
data: {
|
|
39
|
+
requests: upnsChunk.map((upn, index) => ({
|
|
40
|
+
id: index + 1,
|
|
41
|
+
method: 'GET',
|
|
42
|
+
url: `/users/${formatting.encodeQueryParameter(upn)}?$select=id`,
|
|
43
|
+
headers: {
|
|
44
|
+
accept: 'application/json;odata.metadata=none'
|
|
45
|
+
}
|
|
46
|
+
}))
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const res = await request.post(requestOptions);
|
|
50
|
+
for (const response of res.responses) {
|
|
51
|
+
if (response.status !== 200) {
|
|
52
|
+
throw Error(`The specified user with user name '${upnsChunk[response.id - 1]}' does not exist.`);
|
|
53
|
+
}
|
|
54
|
+
userIds.push(response.body.id);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return userIds;
|
|
58
|
+
},
|
|
23
59
|
/**
|
|
24
60
|
* Retrieve the ID of a user by its email.
|
|
25
61
|
* @param mail User email.
|
|
@@ -54,4 +90,4 @@ export const aadUser = {
|
|
|
54
90
|
return res.userPrincipalName;
|
|
55
91
|
}
|
|
56
92
|
};
|
|
57
|
-
//# sourceMappingURL=
|
|
93
|
+
//# sourceMappingURL=entraUser.js.map
|
package/dist/utils/spo.js
CHANGED
|
@@ -8,7 +8,7 @@ import request from "../request.js";
|
|
|
8
8
|
import { formatting } from './formatting.js';
|
|
9
9
|
import { odata } from './odata.js';
|
|
10
10
|
import { RoleType } from '../m365/spo/commands/roledefinition/RoleType.js';
|
|
11
|
-
import {
|
|
11
|
+
import { entraGroup } from './entraGroup.js';
|
|
12
12
|
import { SharingCapabilities } from '../m365/spo/commands/site/SharingCapabilities.js';
|
|
13
13
|
export const spo = {
|
|
14
14
|
getRequestDigest(siteUrl) {
|
|
@@ -996,7 +996,7 @@ export const spo = {
|
|
|
996
996
|
promises.push(request.post(requestOptions));
|
|
997
997
|
}
|
|
998
998
|
if (typeof isPublic !== 'undefined') {
|
|
999
|
-
promises.push(
|
|
999
|
+
promises.push(entraGroup.setGroup(groupId, (isPublic === false), logger, verbose));
|
|
1000
1000
|
}
|
|
1001
1001
|
if (typeof owners !== 'undefined') {
|
|
1002
1002
|
promises.push(spo.setGroupifiedSiteOwners(spoAdminUrl, groupId, owners, logger, verbose));
|
|
@@ -1312,6 +1312,28 @@ export const spo = {
|
|
|
1312
1312
|
responseType: 'json'
|
|
1313
1313
|
};
|
|
1314
1314
|
await request.post(requestOptions);
|
|
1315
|
+
},
|
|
1316
|
+
/**
|
|
1317
|
+
* Retrieves the site ID for a given web URL.
|
|
1318
|
+
* @param webUrl The web URL for which to retrieve the site ID.
|
|
1319
|
+
* @param logger The logger object.
|
|
1320
|
+
* @param verbose Set for verbose logging
|
|
1321
|
+
* @returns A promise that resolves to the site ID.
|
|
1322
|
+
*/
|
|
1323
|
+
async getSiteId(webUrl, logger, verbose) {
|
|
1324
|
+
if (verbose && logger) {
|
|
1325
|
+
logger.logToStderr(`Getting site id for URL: ${webUrl}...`);
|
|
1326
|
+
}
|
|
1327
|
+
const url = new URL(webUrl);
|
|
1328
|
+
const requestOptions = {
|
|
1329
|
+
url: `https://graph.microsoft.com/v1.0/sites/${formatting.encodeQueryParameter(url.host)}:${url.pathname}?$select=id`,
|
|
1330
|
+
headers: {
|
|
1331
|
+
accept: 'application/json;odata.metadata=none'
|
|
1332
|
+
},
|
|
1333
|
+
responseType: 'json'
|
|
1334
|
+
};
|
|
1335
|
+
const site = await request.get(requestOptions);
|
|
1336
|
+
return site.id;
|
|
1315
1337
|
}
|
|
1316
1338
|
};
|
|
1317
1339
|
//# sourceMappingURL=spo.js.map
|
package/dist/utils/urlUtil.js
CHANGED
|
@@ -166,6 +166,37 @@ export const urlUtil = {
|
|
|
166
166
|
relativeUrl = relativeUrl.substring(0, relativeUrl.length - 1);
|
|
167
167
|
}
|
|
168
168
|
return `${baseUrl}/${relativeUrl}`;
|
|
169
|
+
},
|
|
170
|
+
/**
|
|
171
|
+
* Get the absolute URL from the target SharePoint URL.
|
|
172
|
+
* @param {string} webUrl - The base web URL.
|
|
173
|
+
* @param {string} url - The target SharePoint URL.
|
|
174
|
+
* @returns {string} - The target site absolute URL.
|
|
175
|
+
*
|
|
176
|
+
* Example Scenarios:
|
|
177
|
+
* - webUrl = "https://contoso.sharepoint.com" and targetUrl = "/teams/sales/Shared Documents/temp/123/234",
|
|
178
|
+
* returns "https://contoso.sharepoint.com/teams/sales".
|
|
179
|
+
* - webUrl = "https://contoso.sharepoint.com" and targetUrl = "https://contoso-my.sharepoint.com/personal/john_contoso_onmicrosoft_com/Documents/123",
|
|
180
|
+
* returns "https://contoso-my.sharepoint.com/personal/john_contoso_onmicrosoft_com".
|
|
181
|
+
* - webUrl = "https://contoso.sharepoint.com/teams/sales" and targetUrl = "/Shared Documents/temp",
|
|
182
|
+
* returns "https://contoso.sharepoint.com".
|
|
183
|
+
* - webUrl = "https://contoso.sharepoint.com" and targetUrl = "/teams/sales/Shared Documents/temp",
|
|
184
|
+
* returns "https://contoso.sharepoint.com/teams/sales".
|
|
185
|
+
*/
|
|
186
|
+
getTargetSiteAbsoluteUrl(webUrl, url) {
|
|
187
|
+
const fullUrl = url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
188
|
+
// Pattern to match SharePoint URLs
|
|
189
|
+
const urlPattern = /https:\/\/[\w\-]+\.sharepoint\.com\/(teams|sites|personal)\/([\w\-]+)/;
|
|
190
|
+
const match = fullUrl.match(urlPattern);
|
|
191
|
+
if (match) {
|
|
192
|
+
// If a match is found, return the matched URL
|
|
193
|
+
return match[0];
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
// Extract the root URL
|
|
197
|
+
const rootUrl = new URL(fullUrl);
|
|
198
|
+
return rootUrl.origin;
|
|
199
|
+
}
|
|
169
200
|
}
|
|
170
201
|
};
|
|
171
202
|
//# sourceMappingURL=urlUtil.js.map
|
package/dist/utils/validation.js
CHANGED
|
@@ -21,6 +21,10 @@ export const validation = {
|
|
|
21
21
|
const guidRegEx = new RegExp(/^19:[0-9a-zA-Z-_]+(@thread\.v2|@unq\.gbl\.spaces)$/i);
|
|
22
22
|
return guidRegEx.test(guid);
|
|
23
23
|
},
|
|
24
|
+
isValidUserPrincipalNameArray(upns) {
|
|
25
|
+
const invalidGuid = upns.find(upn => !this.isValidUserPrincipalName(upn));
|
|
26
|
+
return invalidGuid || true;
|
|
27
|
+
},
|
|
24
28
|
isValidUserPrincipalName(upn) {
|
|
25
29
|
const upnRegEx = new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/i);
|
|
26
30
|
// verify if the upn is a valid upn. @meusername will be replaced in a later stage with the actual username of the logged in user
|
|
@@ -317,6 +321,10 @@ export const validation = {
|
|
|
317
321
|
return true;
|
|
318
322
|
}
|
|
319
323
|
return false;
|
|
324
|
+
},
|
|
325
|
+
isValidMailNickname(mailNickname) {
|
|
326
|
+
const mailNicknameRegEx = new RegExp(/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]*$/i);
|
|
327
|
+
return mailNicknameRegEx.test(mailNickname);
|
|
320
328
|
}
|
|
321
329
|
};
|
|
322
330
|
//# sourceMappingURL=validation.js.map
|
|
@@ -60,9 +60,9 @@ m365 entra app permission add --appObjectId 'e0306bb2-bf0b-4cc5-a845-a0b2cf11f69
|
|
|
60
60
|
Grant multiple app-only permissions to an Entra (Azure AD) app specified by client id and grant admin consent
|
|
61
61
|
|
|
62
62
|
```sh
|
|
63
|
-
m365 entra app permission add --appId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690' --applicationPermissions 'https://graph.microsoft.com/Sites.FullControl.All https://microsoft.sharepoint-df.com/Sites.FullControl.All' --
|
|
63
|
+
m365 entra app permission add --appId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690' --applicationPermissions 'https://graph.microsoft.com/Sites.FullControl.All https://microsoft.sharepoint-df.com/Sites.FullControl.All' --grantAdminConsent
|
|
64
64
|
```
|
|
65
65
|
|
|
66
66
|
## Response
|
|
67
67
|
|
|
68
|
-
The command won't return a response on success.
|
|
68
|
+
The command won't return a response on success.
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# entra app permission list
|
|
6
|
+
|
|
7
|
+
Lists the application and delegated permissions for a specified Entra Application Registration
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 entra app permission list [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Alias
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
m365 aad app permission list [options]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Options
|
|
22
|
+
|
|
23
|
+
```md definition-list
|
|
24
|
+
`-i, --appId [appId]`
|
|
25
|
+
: Client ID of the Application Registration to retrieve the permissions for. Specify `appId` or `appObjectId` but not both.
|
|
26
|
+
|
|
27
|
+
`--appObjectId [appObjectId]`
|
|
28
|
+
: Object ID of the Application Registration to retrieve the permissions for. Specify `appId` or `appObjectId` but not both.
|
|
29
|
+
|
|
30
|
+
`--type [type]`
|
|
31
|
+
: The type of permissions to retrieve. Allowed values: `delegated`, `application`, `all`. Defaults to `all`.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<Global />
|
|
35
|
+
|
|
36
|
+
## Remarks
|
|
37
|
+
|
|
38
|
+
For best performance use the `objectId` option to reference the Entra application registration to get. If you use `appId`, this command will first need to find the corresponding object ID for that application.
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
Retrieves all permissions for an Entra app registration
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
m365 entra app permission list --appId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Retrieves all delegated permissions for an Entra app registration
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
m365 entra app permission list --appId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690' --type delegated
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Response
|
|
55
|
+
|
|
56
|
+
<Tabs>
|
|
57
|
+
<TabItem value="JSON">
|
|
58
|
+
|
|
59
|
+
```json
|
|
60
|
+
[
|
|
61
|
+
{
|
|
62
|
+
"resource": "Microsoft Graph",
|
|
63
|
+
"resourceId": "00000003-0000-0000-c000-000000000000",
|
|
64
|
+
"permission": "User.Read",
|
|
65
|
+
"type": "Delegated"
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
</TabItem>
|
|
71
|
+
<TabItem value="Text">
|
|
72
|
+
|
|
73
|
+
```text
|
|
74
|
+
resource resourceId permission type
|
|
75
|
+
---------------------------- ------------------------------------ --------------------------------- -----------
|
|
76
|
+
Microsoft Graph 00000003-0000-0000-c000-000000000000 User.Read Delegated
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
</TabItem>
|
|
80
|
+
<TabItem value="CSV">
|
|
81
|
+
|
|
82
|
+
```csv
|
|
83
|
+
resource,resourceId,permission,type
|
|
84
|
+
Microsoft Graph,00000003-0000-0000-c000-000000000000,User.Read,Delegated
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
</TabItem>
|
|
88
|
+
<TabItem value="Markdown">
|
|
89
|
+
|
|
90
|
+
```md
|
|
91
|
+
# entra app permission list --appId "2bf26ae1-9be3-425f-a393-5fe8390e3a36"
|
|
92
|
+
|
|
93
|
+
Date: 27/12/2023
|
|
94
|
+
|
|
95
|
+
Property | Value
|
|
96
|
+
---------|-------
|
|
97
|
+
resource | Microsoft Graph
|
|
98
|
+
resourceId | 00000003-0000-0000-c000-000000000000
|
|
99
|
+
permission | User.Read
|
|
100
|
+
type | Delegated
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
</TabItem>
|
|
104
|
+
</Tabs>
|
|
105
|
+
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# entra group add
|
|
6
|
+
|
|
7
|
+
Creates a Microsoft Entra group
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 entra group add [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Alias
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
m365 aad group add [options]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Options
|
|
22
|
+
|
|
23
|
+
```md definition-list
|
|
24
|
+
`-n, --displayName <displayName>`
|
|
25
|
+
: The name for the group. The maximum length is 256 characters.
|
|
26
|
+
|
|
27
|
+
`-d, --description [description]`
|
|
28
|
+
: The description for the group.
|
|
29
|
+
|
|
30
|
+
`-t, --type <type>`
|
|
31
|
+
: The group type. Valid values: `microsoft365` or `security`.
|
|
32
|
+
|
|
33
|
+
`-m, --mailNickname [mailNickname]`
|
|
34
|
+
: The mail alias for the group (part before the @). Maximum length is 64 characters.
|
|
35
|
+
|
|
36
|
+
`--ownerIds [ownerIds]`
|
|
37
|
+
: Comma-separated list of IDs of Microsoft Entra ID users that will be group owners. Specify either `ownerIds` or `ownerUserNames`, but not both.
|
|
38
|
+
|
|
39
|
+
`--ownerUserNames [ownerUserNames]`
|
|
40
|
+
: Comma-separated list of UPNs of Microsoft Entra ID users that will be group owners. Specify either `ownerIds` or `ownerUserNames`, but not both.
|
|
41
|
+
|
|
42
|
+
`--memberIds [memberIds]`
|
|
43
|
+
: Comma-separated list of IDs of Microsoft Entra ID users that will be group members. Specify either `memberIds` or `memberUserNames`, but not both.
|
|
44
|
+
|
|
45
|
+
`--memberUserNames [memberUserNames]`
|
|
46
|
+
: Comma-separated list of UPNs of Microsoft Entra ID users that will be group members. Specify either `memberIds` or `memberUserNames`, but not both.
|
|
47
|
+
|
|
48
|
+
`--visibility [visibility]`
|
|
49
|
+
: Specifies the group join policy and group content visibility for Microsoft 365 groups. Possible values are: `Private`, `Public`, or `HiddenMembership`. Defaults to `Public`. Specify only when creating a group of type `microsoft365`.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
<Global />
|
|
53
|
+
|
|
54
|
+
## Remarks
|
|
55
|
+
|
|
56
|
+
:::info
|
|
57
|
+
|
|
58
|
+
The `visibility` option affects the behavior of the group.
|
|
59
|
+
|
|
60
|
+
With the `Public` visibility:
|
|
61
|
+
- Anyone can join the group without needing owner permission.
|
|
62
|
+
- Anyone can view the attributes of the group.
|
|
63
|
+
- Anyone can see the members of the group.
|
|
64
|
+
|
|
65
|
+
With the `Private` visibilty:
|
|
66
|
+
- Owner permission is needed to join the group.
|
|
67
|
+
- Anyone can view the attributes of the group.
|
|
68
|
+
- Anyone can see the members of the group.
|
|
69
|
+
|
|
70
|
+
With the `HiddenMembership` visibility:
|
|
71
|
+
- Owner permission is needed to join the group.
|
|
72
|
+
- Guest users cannot view the attributes of the group.
|
|
73
|
+
- Non-members cannot see the members of the group. This setting doesn't affect visibility of group owners.
|
|
74
|
+
- Administrators (global, company, user, and helpdesk) can view the membership of the group.
|
|
75
|
+
- The group appears in the global address book (GAL).
|
|
76
|
+
|
|
77
|
+
:::
|
|
78
|
+
|
|
79
|
+
:::note
|
|
80
|
+
|
|
81
|
+
The `HiddenMembership` visibility can be set only for Microsoft 365 groups when the groups are created. It can't be updated later.
|
|
82
|
+
|
|
83
|
+
:::
|
|
84
|
+
|
|
85
|
+
This command allows using unknown options. For a comprehensive list of group properties, please refer to the [Graph documentation page](https://learn.microsoft.com/graph/api/resources/group?view=graph-rest-1.0#properties).
|
|
86
|
+
|
|
87
|
+
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.
|
|
88
|
+
|
|
89
|
+
## Examples
|
|
90
|
+
|
|
91
|
+
Create a security group without any owners or members
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
m365 entra group add --displayName Developers --type security
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Create a private Microsoft 365 group with owners and members and a custom mail address
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
m365 entra group add --displayName Developers --type microsoft365 --mailNickname devs --ownerUserNames john.doe@contoso.com --memberUserNames "john.doe@contoso.com,adele.vance@contoso.com" --visibility Private
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Create a public Microsoft 365 group without any owners or members
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
m365 entra group add --displayName Developers --type microsoft365 --description "This group is for all developers in the company." --visibility Public
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## Response
|
|
111
|
+
|
|
112
|
+
<Tabs>
|
|
113
|
+
<TabItem value="JSON">
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"id": "ae0e8388-cd70-427f-9503-c57498ee3337",
|
|
118
|
+
"deletedDateTime": null,
|
|
119
|
+
"classification": null,
|
|
120
|
+
"createdDateTime": "2024-01-10T11:33:18Z",
|
|
121
|
+
"creationOptions": [],
|
|
122
|
+
"description": "This group is for all developers in the company.",
|
|
123
|
+
"displayName": "Developers",
|
|
124
|
+
"expirationDateTime": null,
|
|
125
|
+
"groupTypes": [
|
|
126
|
+
"Unified"
|
|
127
|
+
],
|
|
128
|
+
"isAssignableToRole": null,
|
|
129
|
+
"mail": "devs@contoso.com",
|
|
130
|
+
"mailEnabled": true,
|
|
131
|
+
"mailNickname": "devs",
|
|
132
|
+
"membershipRule": null,
|
|
133
|
+
"membershipRuleProcessingState": null,
|
|
134
|
+
"onPremisesDomainName": null,
|
|
135
|
+
"onPremisesLastSyncDateTime": null,
|
|
136
|
+
"onPremisesNetBiosName": null,
|
|
137
|
+
"onPremisesSamAccountName": null,
|
|
138
|
+
"onPremisesSecurityIdentifier": null,
|
|
139
|
+
"onPremisesSyncEnabled": null,
|
|
140
|
+
"preferredDataLocation": null,
|
|
141
|
+
"preferredLanguage": null,
|
|
142
|
+
"proxyAddresses": [
|
|
143
|
+
"SMTP:devs@contoso.com"
|
|
144
|
+
],
|
|
145
|
+
"renewedDateTime": "2024-01-10T11:33:18Z",
|
|
146
|
+
"resourceBehaviorOptions": [],
|
|
147
|
+
"resourceProvisioningOptions": [],
|
|
148
|
+
"securityEnabled": true,
|
|
149
|
+
"securityIdentifier": "S-1-12-1-2920186760-1115671920-1959068565-926150296",
|
|
150
|
+
"theme": null,
|
|
151
|
+
"visibility": "Public",
|
|
152
|
+
"onPremisesProvisioningErrors": [],
|
|
153
|
+
"serviceProvisioningErrors": []
|
|
154
|
+
}
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
</TabItem>
|
|
158
|
+
<TabItem value="Text">
|
|
159
|
+
|
|
160
|
+
```text
|
|
161
|
+
classification : null
|
|
162
|
+
createdDateTime : 2024-01-10T11:36:31Z
|
|
163
|
+
creationOptions : []
|
|
164
|
+
deletedDateTime : null
|
|
165
|
+
description : This group is for all developers in the company.
|
|
166
|
+
displayName : Developers
|
|
167
|
+
expirationDateTime : null
|
|
168
|
+
groupTypes : ["Unified"]
|
|
169
|
+
id : f7bce6b2-c017-4a00-ba0c-fbbe458364aa
|
|
170
|
+
isAssignableToRole : null
|
|
171
|
+
mail : dev@contoso.com
|
|
172
|
+
mailEnabled : true
|
|
173
|
+
mailNickname : devs
|
|
174
|
+
membershipRule : null
|
|
175
|
+
membershipRuleProcessingState: null
|
|
176
|
+
onPremisesDomainName : null
|
|
177
|
+
onPremisesLastSyncDateTime : null
|
|
178
|
+
onPremisesNetBiosName : null
|
|
179
|
+
onPremisesProvisioningErrors : []
|
|
180
|
+
onPremisesSamAccountName : null
|
|
181
|
+
onPremisesSecurityIdentifier : null
|
|
182
|
+
onPremisesSyncEnabled : null
|
|
183
|
+
preferredDataLocation : null
|
|
184
|
+
preferredLanguage : null
|
|
185
|
+
proxyAddresses : ["SMTP:devs@contoso.com"]
|
|
186
|
+
renewedDateTime : 2024-01-10T11:36:31Z
|
|
187
|
+
resourceBehaviorOptions : []
|
|
188
|
+
resourceProvisioningOptions : []
|
|
189
|
+
securityEnabled : true
|
|
190
|
+
securityIdentifier : S-1-12-1-4156352178-1241563159-3204123834-2858713925
|
|
191
|
+
serviceProvisioningErrors : []
|
|
192
|
+
theme : null
|
|
193
|
+
visibility : Public
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
</TabItem>
|
|
197
|
+
<TabItem value="CSV">
|
|
198
|
+
|
|
199
|
+
```csv
|
|
200
|
+
id,deletedDateTime,classification,createdDateTime,description,displayName,expirationDateTime,isAssignableToRole,mail,mailEnabled,mailNickname,membershipRule,membershipRuleProcessingState,onPremisesDomainName,onPremisesLastSyncDateTime,onPremisesNetBiosName,onPremisesSamAccountName,onPremisesSecurityIdentifier,onPremisesSyncEnabled,preferredDataLocation,preferredLanguage,renewedDateTime,securityEnabled,securityIdentifier,theme,visibility
|
|
201
|
+
4c63e8cd-eb2b-4b0d-9251-d709cc75cf5e,,,2024-01-10T11:37:02Z,This group is for all developers in the company.,Developers,,,devs@contoso.com,1,devs,,,,,,,,,,,2024-01-10T11:37:02Z,1,S-1-12-1-1281616077-1259203371-165106066-1590654412,,Public
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
</TabItem>
|
|
205
|
+
<TabItem value="Markdown">
|
|
206
|
+
|
|
207
|
+
```md
|
|
208
|
+
# entra group add --displayName "Developers" --type "microsoft365" --description "This group is for all developers in the company." --visibility "Public" --mailNickname "devs"
|
|
209
|
+
|
|
210
|
+
Date: 1/10/2024
|
|
211
|
+
|
|
212
|
+
## Developers (b3fd8e8f-eced-45c7-a366-178bc5c1db37)
|
|
213
|
+
|
|
214
|
+
Property | Value
|
|
215
|
+
---------|-------
|
|
216
|
+
id | b3fd8e8f-eced-45c7-a366-178bc5c1db37
|
|
217
|
+
createdDateTime | 2024-01-10T11:37:39Z
|
|
218
|
+
description | This group is for all developers in the company.
|
|
219
|
+
displayName | Developers
|
|
220
|
+
mail | devs@contoso.com
|
|
221
|
+
mailEnabled | true
|
|
222
|
+
mailNickname | devs
|
|
223
|
+
renewedDateTime | 2024-01-10T11:37:39Z
|
|
224
|
+
securityEnabled | true
|
|
225
|
+
securityIdentifier | S-1-12-1-3019738767-1170730221-2333566627-937148869
|
|
226
|
+
visibility | Public
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
</TabItem>
|
|
230
|
+
</Tabs>
|
|
231
|
+
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
|
|
3
|
+
# entra group user add
|
|
4
|
+
|
|
5
|
+
Adds a user to a Microsoft Entra ID group
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
m365 entra group user add [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
|
|
15
|
+
```md definition-list
|
|
16
|
+
`-i, --groupId [groupId]`
|
|
17
|
+
: The ID of the Entra ID group. Specify `groupId` or `groupDisplayName` but not both.
|
|
18
|
+
|
|
19
|
+
`-n, --groupDisplayName [groupDisplayName]`
|
|
20
|
+
: The display name of the Entra ID group. Specify `groupId` or `groupDisplayName` but not both.
|
|
21
|
+
|
|
22
|
+
`--ids [ids]`
|
|
23
|
+
: Entra ID IDs of users. You can also pass a comma-separated list of IDs. Specify either `ids` or `userNames` but not both.
|
|
24
|
+
|
|
25
|
+
`--userNames [userNames]`
|
|
26
|
+
: The user principal names of users. You can also pass a comma-separated list of UPNs. Specify either `ids` or `userNames` but not both.
|
|
27
|
+
|
|
28
|
+
`-r, --role <role>`
|
|
29
|
+
: The role to be assigned to the new users. Valid values: `Owner`, `Member`.
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
<Global />
|
|
33
|
+
|
|
34
|
+
## Examples
|
|
35
|
+
|
|
36
|
+
Add a single user specified by ID as a member to a group specified by display name
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
m365 entra group user add --groupDisplayName Developers --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Add multiple users specified by ID as members to a group specified by ID
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
m365 entra group user add --groupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --ids "098b9f52-f48c-4401-819f-29c33794c3f5,f1e06e31-3abf-4746-83c2-1513d71f38b8" --role Member
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Add a single user specified by UPN as an owner to a group specified by display name
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
m365 entra group user add --groupDisplayName Developers --userNames john.doe@contoso.com --role Owner
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Adds multiple users specified by UPN as owners to a group specified by ID
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
m365 entra group user add --groupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --userNames "john.doe@contoso.com,adele.vance@contoso.com" --role Owner
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Response
|
|
61
|
+
|
|
62
|
+
The command won't return a response on success.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
|
|
3
|
+
# file copy
|
|
4
|
+
|
|
5
|
+
Copies a file to another location using the Microsoft Graph
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
m365 file copy [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
|
+
## Examples
|
|
35
|
+
|
|
36
|
+
Copy a file by server-relative URL to a document library in another site collection with server relative URL
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
m365 file copy --webUrl https://contoso.sharepoint.com/sites/project --sourceUrl "/sites/project/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents"
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Copy a file by absolute URL to a document library in another site collection with absolute URL
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
m365 file copy --webUrl https://contoso.sharepoint.com --sourceUrl "https://contoso.sharepoint.com/Shared Documents/Document.pdf" --targetUrl "https://contoso.sharepoint.com/sites/IT/Shared Documents"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Copy a file to a document library in another site collection and rename the file
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
m365 file copy --webUrl https://contoso.sharepoint.com --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents" --newName "newName"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Copy a file to a document library in another site collection and rename the file if a file with the same name already exists.
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
m365 file copy --webUrl https://contoso.sharepoint.com --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "/sites/IT/Shared Documents" --nameConflictBehavior rename
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Copy a file to Onedrive for business
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
m365 file copy --webUrl https://contoso.sharepoint.com --sourceUrl "/Shared Documents/Document.pdf" --targetUrl "https://contoso-my.sharepoint.com/personal/john_contoso_onmicrosoft_com/documents"
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Response
|
|
67
|
+
|
|
68
|
+
The command won't return a response on success.
|
|
@@ -18,7 +18,7 @@ m365 spo listitem list [options]
|
|
|
18
18
|
`-u, --webUrl <webUrl>`
|
|
19
19
|
: URL of the site from which the item should be retrieved.
|
|
20
20
|
|
|
21
|
-
`-
|
|
21
|
+
`-i, --listId [listId]`
|
|
22
22
|
: ID of the list. Specify either `listTitle`, `listId`, or `listUrl` but not multiple.
|
|
23
23
|
|
|
24
24
|
`-t, --listTitle [listTitle]`
|