@pnp/cli-microsoft365 10.3.0-beta.d1b978f → 10.3.0-beta.f5e6f85
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/.eslintrc.cjs +1 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/config.js +1 -0
- package/dist/m365/entra/commands/pim/pim-role-assignment-remove.js +186 -0
- package/dist/m365/entra/commands/roledefinition/roledefinition-add.js +58 -0
- package/dist/m365/entra/commands/roledefinition/roledefinition-set.js +84 -0
- package/dist/m365/entra/commands.js +3 -0
- package/dist/m365/exo/commands/approleassignment/approleassignment-add.js +235 -0
- package/dist/m365/exo/commands.js +5 -0
- package/dist/m365/outlook/commands/mailbox/mailbox-settings-set.js +163 -0
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/pp/commands/website/website-get.js +60 -0
- package/dist/m365/pp/commands.js +2 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +0 -13
- package/dist/m365/tenant/commands/people/people-pronouns-set.js +46 -0
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/utils/customAppScope.js +29 -0
- package/dist/utils/entraServicePrincipal.js +46 -0
- package/dist/utils/powerPlatform.js +38 -0
- package/dist/utils/roleDefinition.js +23 -0
- package/dist/utils/validation.js +4 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-remove.mdx +197 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-add.mdx +127 -0
- package/docs/docs/cmd/entra/roledefinition/roledefinition-set.mdx +60 -0
- package/docs/docs/cmd/exo/approleassignment/approleassignment-add.mdx +170 -0
- package/docs/docs/cmd/outlook/mailbox/mailbox-settings-set.mdx +166 -0
- package/docs/docs/cmd/pp/website/website-get.mdx +153 -0
- package/docs/docs/cmd/tenant/people/people-pronouns-set.mdx +82 -0
- package/npm-shrinkwrap.json +54 -74
- package/package.json +9 -9
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# entra pim role assignment remove
|
|
6
|
+
|
|
7
|
+
Request deactivation of an Entra role assignment for a user or group.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 entra pim role assignment remove [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-n, --roleDefinitionName [roleDefinitionName]`
|
|
19
|
+
: Name of the role definition that should be assigned. Specify either `roleDefinitionName` or `roleDefinitionId` but not both.
|
|
20
|
+
|
|
21
|
+
`-i, --roleDefinitionId [roleDefinitionId]`
|
|
22
|
+
: Id of the role definition that is being assigned. Specify either `roleDefinitionName` or `roleDefinitionId` but not both.
|
|
23
|
+
|
|
24
|
+
`--userId [userId]`
|
|
25
|
+
: Id of the user that will be granted the assignment. Specify either `userId`, `userName`, `groupId` or `groupName`. If not specified, the current user will be used.
|
|
26
|
+
|
|
27
|
+
`--userName [userName]`
|
|
28
|
+
: UPN of the user that will be granted the assignment. Specify either `userId`, `userName`, `groupId` or `groupName`. If not specified, the current user will be used.
|
|
29
|
+
|
|
30
|
+
`--groupId [groupId]`
|
|
31
|
+
: Id of the group that will be granted the assignment. Specify either `userId`, `userName`, `groupId` or `groupName`. If not specified, the current user will be used.
|
|
32
|
+
|
|
33
|
+
`--groupName [groupName]`
|
|
34
|
+
: Display name of the group that will be granted the assignment. Specify either `userId`, `userName`, `groupId` or `groupName`. If not specified, the current user will be used.
|
|
35
|
+
|
|
36
|
+
`--administrativeUnitId [administrativeUnitId]`
|
|
37
|
+
: Id of the administrative unit representing the scope of the assignment. Specify either `administrativeUnitId` or `applicationId`. If not specified, default scope will be tenant-wide.
|
|
38
|
+
|
|
39
|
+
`--applicationId [applicationId]`
|
|
40
|
+
: Object Id of the application representing the scope of the assignment. Specify either `administrativeUnitId` or `applicationId`. If not specified, default scope will be tenant-wide.
|
|
41
|
+
|
|
42
|
+
`-j, --justification [justification]`
|
|
43
|
+
: An optional justification message.
|
|
44
|
+
|
|
45
|
+
`--ticketNumber [ticketNumber]`
|
|
46
|
+
: Optional ticket number value to communicate with the request.
|
|
47
|
+
|
|
48
|
+
`--ticketSystem [ticketSystem]`
|
|
49
|
+
: Optional ticket system to communicate with the request.
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
<Global />
|
|
53
|
+
|
|
54
|
+
## Remarks
|
|
55
|
+
|
|
56
|
+
:::info
|
|
57
|
+
|
|
58
|
+
When deactivating a role for other users, you must be **Privileged Role Administrator**.
|
|
59
|
+
|
|
60
|
+
:::
|
|
61
|
+
|
|
62
|
+
## Examples
|
|
63
|
+
|
|
64
|
+
Request deactivation of the SharePoint Administrator Entra role assignment for the current user.
|
|
65
|
+
|
|
66
|
+
```sh
|
|
67
|
+
m365 entra pim role assignment remove --roleDefinitionName 'SharePoint Administrator'
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Request deactivation of an Entra role assignment for the current user.
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
m365 entra pim role assignment remove --roleDefinitionId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690'
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Request deactivation of an Entra role assignment for the current user with a justification
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
m365 entra pim role assignment remove --roleDefinitionId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690' --justification 'Need Global Admin to release application xyz to production'
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Request deactivation of an Entra role assignment for a specified user with tenant scope.
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
m365 entra pim role assignment remove --roleDefinitionId 'f1417aa3-bf0b-4cc5-a845-a0b2cf11f690' --userId '3488d6b8-6b2e-41c3-9583-1991205323c2'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Request deactivation of the User Administrator Entra role assignment for a specified group with administrative unit scope.
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
m365 entra pim role assignment remove --roleDefinitionName 'User Administrator' --groupId '3488d6b8-6b2e-41c3-9583-1991205323c2' --administrativeUnitId '03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Request deactivation of the Application Administrator Entra role assignment for a specified group with scope to a specific application.
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
m365 entra pim role assignment remove --roleDefinitionName 'Application Administrator' --groupName 'Applications admins' --applicationId '03c4c9dc-6f0c-4c4f-a4e6-0c9ed80f54c7'
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Response
|
|
101
|
+
|
|
102
|
+
<Tabs>
|
|
103
|
+
<TabItem value="JSON">
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"id": "3f7d1bd6-a9a5-45bc-b831-00cfa3e3c649",
|
|
108
|
+
"status": "Revoked",
|
|
109
|
+
"createdDateTime": "2024-07-30T12:08:29.7734603Z",
|
|
110
|
+
"completedDateTime": null,
|
|
111
|
+
"approvalId": null,
|
|
112
|
+
"customData": null,
|
|
113
|
+
"action": "adminRemove",
|
|
114
|
+
"principalId": "61b0c52f-a902-4769-9a09-c6628335b00a",
|
|
115
|
+
"roleDefinitionId": "f28a1f50-f6e7-4571-818b-6a12f2af6b6c",
|
|
116
|
+
"directoryScopeId": "/",
|
|
117
|
+
"appScopeId": null,
|
|
118
|
+
"isValidationOnly": false,
|
|
119
|
+
"targetScheduleId": null,
|
|
120
|
+
"justification": "Removing SharePoint Administrator role",
|
|
121
|
+
"createdBy": {
|
|
122
|
+
"application": null,
|
|
123
|
+
"device": null,
|
|
124
|
+
"user": {
|
|
125
|
+
"displayName": null,
|
|
126
|
+
"id": "893f9116-e024-4bc6-8e98-54c245129485"
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"scheduleInfo": null,
|
|
130
|
+
"ticketInfo": {
|
|
131
|
+
"ticketNumber": null,
|
|
132
|
+
"ticketSystem": null
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
</TabItem>
|
|
138
|
+
<TabItem value="Text">
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
action : adminRemove
|
|
142
|
+
appScopeId : null
|
|
143
|
+
approvalId : null
|
|
144
|
+
completedDateTime: null
|
|
145
|
+
createdBy : null
|
|
146
|
+
createdDateTime : 2024-07-30T12:08:29.7734603Z
|
|
147
|
+
customData : null
|
|
148
|
+
directoryScopeId : /
|
|
149
|
+
id : c221e106-0711-470a-83cf-f8d7cbc51ecd
|
|
150
|
+
isValidationOnly : false
|
|
151
|
+
justification : Removing SharePoint Administrator role
|
|
152
|
+
principalId : 61b0c52f-a902-4769-9a09-c6628335b00a
|
|
153
|
+
roleDefinitionId : f28a1f50-f6e7-4571-818b-6a12f2af6b6c
|
|
154
|
+
scheduleInfo : null
|
|
155
|
+
status : Revoked
|
|
156
|
+
targetScheduleId : c221e106-0711-470a-83cf-f8d7cbc51ecd
|
|
157
|
+
ticketInfo : {"ticketNumber":null,"ticketSystem":null}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
</TabItem>
|
|
161
|
+
<TabItem value="CSV">
|
|
162
|
+
|
|
163
|
+
```csv
|
|
164
|
+
id,status,createdDateTime,completedDateTime,approvalId,customData,action,principalId,roleDefinitionId,directoryScopeId,appScopeId,isValidationOnly,targetScheduleId,justification
|
|
165
|
+
7d727f44-c2dd-459e-8665-99ce003d12a9,Revoked,2024-07-30T12:08:29.7734603Z,,,,adminRemove,61b0c52f-a902-4769-9a09-c6628335b00a,f28a1f50-f6e7-4571-818b-6a12f2af6b6c,/,,,7d727f44-c2dd-459e-8665-99ce003d12a9,Removing SharePoint Administrator role
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
</TabItem>
|
|
169
|
+
<TabItem value="Markdown">
|
|
170
|
+
|
|
171
|
+
```md
|
|
172
|
+
# entra pim roleassignment remove --roleDefinitionId "f28a1f50-f6e7-4571-818b-6a12f2af6b6c" --userId "61b0c52f-a902-4769-9a09-c6628335b00a" --justification "Removing SharePoint Administrator role"
|
|
173
|
+
|
|
174
|
+
Date: 7/30/2024
|
|
175
|
+
|
|
176
|
+
## 7622802f-648b-4dd9-820f-dccaf8bbbab5
|
|
177
|
+
|
|
178
|
+
Property | Value
|
|
179
|
+
---------|-------
|
|
180
|
+
id | 7622802f-648b-4dd9-820f-dccaf8bbbab5
|
|
181
|
+
status | Revoked
|
|
182
|
+
createdDateTime | 2024-07-30T12:08:29.7734603Z
|
|
183
|
+
action | adminRemove
|
|
184
|
+
principalId | 61b0c52f-a902-4769-9a09-c6628335b00a
|
|
185
|
+
roleDefinitionId | f28a1f50-f6e7-4571-818b-6a12f2af6b6c
|
|
186
|
+
directoryScopeId | /
|
|
187
|
+
isValidationOnly | false
|
|
188
|
+
targetScheduleId | 7622802f-648b-4dd9-820f-dccaf8bbbab5
|
|
189
|
+
justification | Removing SharePoint Administrator role
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
</TabItem>
|
|
193
|
+
</Tabs>
|
|
194
|
+
|
|
195
|
+
## More information
|
|
196
|
+
|
|
197
|
+
- Role assignment request: https://learn.microsoft.com/graph/api/rbacapplication-post-roleassignmentschedulerequests
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# entra roledefinition add
|
|
6
|
+
|
|
7
|
+
Creates a custom Microsoft Entra ID role definition
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 entra roledefinition add [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-n, --displayName <displayName>`
|
|
19
|
+
: The display name for the role definition.
|
|
20
|
+
|
|
21
|
+
`-a, --allowedResourceActions <allowedResourceActions>`
|
|
22
|
+
: Comma-separated list of resource actions allowed for the role.
|
|
23
|
+
|
|
24
|
+
`-d, --description [description]`
|
|
25
|
+
: The description for the role definition.
|
|
26
|
+
|
|
27
|
+
`-e, --enabled [enabled]`
|
|
28
|
+
: Indicates if the role is enabled for the assignment. If not specified, the role is enabled by default.
|
|
29
|
+
|
|
30
|
+
`-v, --version [version]`
|
|
31
|
+
: The version of the role definition.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<Global />
|
|
35
|
+
|
|
36
|
+
## Examples
|
|
37
|
+
|
|
38
|
+
Create a custom Microsoft Entra ID role
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
m365 entra roledefinition add --displayName 'Application Remover' --description 'Allows to remove any Entra ID application' --allowedResourceActions 'microsoft.directory/applications/delete'
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Create a custom Microsoft Entra ID role, but disable it for the assignment
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
m365 entra roledefinition add --displayName 'Application Remover' --version '1.0' --enabled false --allowedResourceActions 'microsoft.directory/applications/delete,microsoft.directory/applications/owners/update'
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Response
|
|
51
|
+
|
|
52
|
+
<Tabs>
|
|
53
|
+
<TabItem value="JSON">
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"id": "3844129d-f748-4c03-8165-4412ee9b4ceb",
|
|
58
|
+
"description": null,
|
|
59
|
+
"displayName": "Custom Role",
|
|
60
|
+
"isBuiltIn": false,
|
|
61
|
+
"isEnabled": true,
|
|
62
|
+
"resourceScopes": [
|
|
63
|
+
"/"
|
|
64
|
+
],
|
|
65
|
+
"templateId": "3844129d-f748-4c03-8165-4412ee9b4ceb",
|
|
66
|
+
"version": "1",
|
|
67
|
+
"rolePermissions": [
|
|
68
|
+
{
|
|
69
|
+
"allowedResourceActions": [
|
|
70
|
+
"microsoft.directory/groups.unified/create",
|
|
71
|
+
"microsoft.directory/groups.unified/delete"
|
|
72
|
+
],
|
|
73
|
+
"condition": null
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
</TabItem>
|
|
80
|
+
<TabItem value="Text">
|
|
81
|
+
|
|
82
|
+
```text
|
|
83
|
+
description : null
|
|
84
|
+
displayName : Custom Role
|
|
85
|
+
id : 3844129d-f748-4c03-8165-4412ee9b4ceb
|
|
86
|
+
isBuiltIn : false
|
|
87
|
+
isEnabled : true
|
|
88
|
+
resourceScopes : ["/"]
|
|
89
|
+
rolePermissions: [{"allowedResourceActions":["microsoft.directory/groups.unified/create","microsoft.directory/groups.unified/delete"],"condition":null}]
|
|
90
|
+
templateId : 3844129d-f748-4c03-8165-4412ee9b4ceb
|
|
91
|
+
version : 1
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
</TabItem>
|
|
95
|
+
<TabItem value="CSV">
|
|
96
|
+
|
|
97
|
+
```csv
|
|
98
|
+
id,description,displayName,isBuiltIn,isEnabled,templateId,version
|
|
99
|
+
3844129d-f748-4c03-8165-4412ee9b4ceb,,Custom Role,0,1,3844129d-f748-4c03-8165-4412ee9b4ceb,1
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
</TabItem>
|
|
103
|
+
<TabItem value="Markdown">
|
|
104
|
+
|
|
105
|
+
```md
|
|
106
|
+
# entra roledefinition add --displayName "Custom Role" --allowedResourceActions "microsoft.directory/groups.unified/create,microsoft.directory/groups.unified/delete" --version 1
|
|
107
|
+
|
|
108
|
+
Date: 12/15/2024
|
|
109
|
+
|
|
110
|
+
## Custom Role (3844129d-f748-4c03-8165-4412ee9b4ceb)
|
|
111
|
+
|
|
112
|
+
Property | Value
|
|
113
|
+
---------|-------
|
|
114
|
+
id | 3844129d-f748-4c03-8165-4412ee9b4ceb
|
|
115
|
+
displayName | Custom Role
|
|
116
|
+
isBuiltIn | false
|
|
117
|
+
isEnabled | true
|
|
118
|
+
templateId | 3844129d-f748-4c03-8165-4412ee9b4ceb
|
|
119
|
+
version | 1
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
</TabItem>
|
|
123
|
+
</Tabs>
|
|
124
|
+
|
|
125
|
+
## More information
|
|
126
|
+
|
|
127
|
+
- https://learn.microsoft.com/graph/api/rbacapplication-post-roledefinitions
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
|
|
3
|
+
# entra roledefinition set
|
|
4
|
+
|
|
5
|
+
Updates a custom Microsoft Entra ID role definition
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
m365 entra roledefinition set [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
|
|
15
|
+
```md definition-list
|
|
16
|
+
`-i, --id [id]`
|
|
17
|
+
: The id of the role definition to be updated. Specify either `id` or `displayName`, but not both.
|
|
18
|
+
|
|
19
|
+
`-n, --displayName [displayName]`
|
|
20
|
+
: The display name of the role definition to be updated. Specify either `id` or `displayName`, but not both.
|
|
21
|
+
|
|
22
|
+
`--newDisplayName [newDisplayName]`
|
|
23
|
+
: Updated display name for the role definition.
|
|
24
|
+
|
|
25
|
+
`-d, --description [description]`
|
|
26
|
+
: Updated description for the role definition.
|
|
27
|
+
|
|
28
|
+
`-e, --enabled [enabled]`
|
|
29
|
+
: Indicates if the role is enabled for the assignment.
|
|
30
|
+
|
|
31
|
+
`a-, --allowedResourceActions [allowedResourceActions]`
|
|
32
|
+
: Updated comma-separated list of resource actions allowed for the role.
|
|
33
|
+
|
|
34
|
+
`-v, --version [version]`
|
|
35
|
+
: Updated version of the role definition.
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
<Global />
|
|
39
|
+
|
|
40
|
+
## Examples
|
|
41
|
+
|
|
42
|
+
Update a custom Microsoft Entra ID role specified by the id
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
m365 entra roledefinition set --id fadbc488-151d-4431-9143-6abbffae759f --newDisplayName 'Application Remover' --description 'Allows to remove any Entra ID application' --allowedResourceActions 'microsoft.directory/applications/delete'
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Update a custom Microsoft Entra ID role specified by the display name
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
m365 entra roledefinition set --displayName 'Application Remover' --version '1.0' --enabled true --allowedResourceActions 'microsoft.directory/applications/delete,microsoft.directory/applications/owners/update'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Response
|
|
55
|
+
|
|
56
|
+
The command won't return a response on success
|
|
57
|
+
|
|
58
|
+
## More information
|
|
59
|
+
|
|
60
|
+
- https://learn.microsoft.com/graph/api/rbacapplication-post-roledefinitions
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# exo approleassignment add
|
|
6
|
+
|
|
7
|
+
Grants permissions to an application that's accessing data in Exchange Online and specify which mailboxes an app can access.
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 exo approleassignment add [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`--roleDefinitionId [roleDefinitionId]`
|
|
19
|
+
: Id of a role to be assigned. Specify either `roleDefinitionId` or `roleDefinitionName`, but not both.
|
|
20
|
+
|
|
21
|
+
`--roleDefinitionName [roleDefinitionName]`
|
|
22
|
+
: Name of a role to be assigned. Specify either `roleDefinitionId` or `roleDefinitionName`, but not both.
|
|
23
|
+
|
|
24
|
+
`--principalId [principalId]`
|
|
25
|
+
: Id of a service principal to which the assignment is granted. Specify either `principalId` or `principalName`, but not both.
|
|
26
|
+
|
|
27
|
+
`--principalName [principalName]`
|
|
28
|
+
: Name of a service principal to which the assignment is granted. Specify either `principalId` or `principalName`, but not both.
|
|
29
|
+
|
|
30
|
+
`-s, --scope <scope>`
|
|
31
|
+
: Scope of the roleassignment. Allowed values are: `tenant`, `administrativeUnit`, `group`, `user`, `custom`.
|
|
32
|
+
|
|
33
|
+
`--userId [userId]`
|
|
34
|
+
: Id of a user to which the assignment is scoped. Specify either `userId` or `userName` when scope is set to `user`.
|
|
35
|
+
|
|
36
|
+
`--userName [userName]`
|
|
37
|
+
: UPN of a user to which the assignment is scoped. Specify either `userId` or `userName` when scope is set to `user`.
|
|
38
|
+
|
|
39
|
+
`--groupId [groupId]`
|
|
40
|
+
: Id of a group to which the assignment is scoped. Specify either `groupId` or `groupName` when scope is set to `group`.
|
|
41
|
+
|
|
42
|
+
`--groupName [groupName]`
|
|
43
|
+
: Name of a group to which the assignment is scoped. Specify either `groupId` or `groupName` when scope is set to `group`.
|
|
44
|
+
|
|
45
|
+
`--administrativeUnitId [administrativeUnitId]`
|
|
46
|
+
: Id of an administrative unit to which the assignment is scoped. Specify either `administrativeUnitId` or `administrativeUnitName` when scope is set to `administrativeUnit`.
|
|
47
|
+
|
|
48
|
+
`--administrativeUnitName [administrativeUnitName]`
|
|
49
|
+
: Name of an administrative unit to which the assignment is scoped. Specify either `administrativeUnitId` or `administrativeUnitName` when scope is set to `administrativeUnit`.
|
|
50
|
+
|
|
51
|
+
`--customAppScopeId [customAppScopeId]`
|
|
52
|
+
: Id of a custom application scope to which the assignment is scoped. Specify either `customAppScopeId` or `customAppScopeName` when scope is set to `custom`.
|
|
53
|
+
|
|
54
|
+
`--customAppScopeName [customAppScopeName]`
|
|
55
|
+
: Name of a custom application scope to which the assignment is scoped. Specify either `customAppScopeId` or `customAppScopeName` when scope is set to `custom`.
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
<Global />
|
|
59
|
+
|
|
60
|
+
## Remarks
|
|
61
|
+
|
|
62
|
+
:::info
|
|
63
|
+
|
|
64
|
+
To use this command you must be at least **Privileged Role Administrator**.
|
|
65
|
+
|
|
66
|
+
:::
|
|
67
|
+
|
|
68
|
+
## Examples
|
|
69
|
+
|
|
70
|
+
Assign a role specified by id to a service principal specified by id and scope the assignment to the whole tenant
|
|
71
|
+
|
|
72
|
+
```sh
|
|
73
|
+
m365 exo approleassignment add --roleDefinitionId 777b752-f9b7-4205-a2b1-5db0d6a0ccfc --principalId 7a2ca997-9461-402e-9882-58088a370889 --scope tenant
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Assign a role specified by id to a service principal specified by id and scope the assignment to a user specified by id
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
m365 exo approleassignment add --roleDefinitionId 777b752-f9b7-4205-a2b1-5db0d6a0ccfc --principalId 7a2ca997-9461-402e-9882-58088a370889 --scope user --userId a4738dd8-fc0f-4646-87fb-47539f5c651b
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Assign a role specified by name to a service principal specified by name and scope the assignment to a group specified by name
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
m365 exo approleassignment add --roleDefinitionName 'Application Contacts.ReadWrite' --principalName 'ContactsSyncApp' --scope group --groupName 'Marketing'
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Assign a role specified by name to a service principal specified by id and scope the assignment to an administrative unit specified by name
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
m365 exo approleassignment add --roleDefinitionName 'Application Calendars.Read' --principalId fa631c4d-ac9f-4884-a7f5-13c659d177e3 --scope administrativeUnit --administrativeUnitName 'Equipment - EMEA'
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
## Response
|
|
95
|
+
|
|
96
|
+
<Tabs>
|
|
97
|
+
<TabItem value="JSON">
|
|
98
|
+
|
|
99
|
+
```json
|
|
100
|
+
{
|
|
101
|
+
"id": "6615d221-3834-4f8f-bbc9-7d0d23620a8e",
|
|
102
|
+
"principalId": "/ServicePrincipals/e483a0d9-8440-455e-8f9a-b9cac6b8b0ef",
|
|
103
|
+
"roleDefinitionId": "1f704712-7d46-481f-b2cd-dbcc978c4f2a",
|
|
104
|
+
"directoryScopeId": "/",
|
|
105
|
+
"appScopeId": null
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
</TabItem>
|
|
110
|
+
<TabItem value="Text">
|
|
111
|
+
|
|
112
|
+
```text
|
|
113
|
+
appScopeId : null
|
|
114
|
+
directoryScopeId: /
|
|
115
|
+
id : 6615d221-3834-4f8f-bbc9-7d0d23620a8e
|
|
116
|
+
principalId : /ServicePrincipals/e483a0d9-8440-455e-8f9a-b9cac6b8b0ef
|
|
117
|
+
roleDefinitionId: 1f704712-7d46-481f-b2cd-dbcc978c4f2a
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
</TabItem>
|
|
121
|
+
<TabItem value="CSV">
|
|
122
|
+
|
|
123
|
+
```csv
|
|
124
|
+
id,principalId,roleDefinitionId,directoryScopeId,appScopeId
|
|
125
|
+
6615d221-3834-4f8f-bbc9-7d0d23620a8e,/ServicePrincipals/e483a0d9-8440-455e-8f9a-b9cac6b8b0ef,1f704712-7d46-481f-b2cd-dbcc978c4f2a,/,
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
</TabItem>
|
|
129
|
+
<TabItem value="Markdown">
|
|
130
|
+
|
|
131
|
+
```md
|
|
132
|
+
# exo approleassignment add --debug "false" --verbose "false" --roleDefinitionId "1f704712-7d46-481f-b2cd-dbcc978c4f2a" --principalId "e483a0d9-8440-455e-8f9a-b9cac6b8b0ef" --scope tenant
|
|
133
|
+
|
|
134
|
+
Date: 10/3/2024
|
|
135
|
+
|
|
136
|
+
## 6615d221-3834-4f8f-bbc9-7d0d23620a8e
|
|
137
|
+
|
|
138
|
+
Property | Value
|
|
139
|
+
---------|-------
|
|
140
|
+
id | 6615d221-3834-4f8f-bbc9-7d0d23620a8e
|
|
141
|
+
principalId | /ServicePrincipals/e483a0d9-8440-455e-8f9a-b9cac6b8b0ef
|
|
142
|
+
roleDefinitionId | 1f704712-7d46-481f-b2cd-dbcc978c4f2a
|
|
143
|
+
directoryScopeId | /
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
</TabItem>
|
|
147
|
+
</Tabs>
|
|
148
|
+
|
|
149
|
+
## More information
|
|
150
|
+
|
|
151
|
+
- Role assignment: https://learn.microsoft.com/graph/api/rbacapplication-post-roleassignments?view=graph-rest-beta
|
|
152
|
+
|
|
153
|
+
The table below lists the available roles and their corresponding ids that are accepted by the `roleDefinitionId` and `roleDefinitionName` parameters.
|
|
154
|
+
|
|
155
|
+
|Role Definition Id | Role Definition Name |
|
|
156
|
+
| --- | --- |
|
|
157
|
+
|1f704712-7d46-481f-b2cd-dbcc978c4f2a|Application Mail.Read|
|
|
158
|
+
|3eca55c8-0e73-4c12-81bf-526549f2e5a3|Application Mail.ReadBasic|
|
|
159
|
+
|82fd214e-61ca-4dc7-98f6-090700bdb205|Application Mail.ReadWrite|
|
|
160
|
+
|8679f4ff-c91d-40d0-809c-c86d114821a5|Application Mail.Send|
|
|
161
|
+
|c40299e0-2107-455f-85dd-6e8862c3a0cc|Application MailboxSettings.Read|
|
|
162
|
+
|459cb245-07c5-44f1-8133-3da40b4b6197|Application MailboxSettings.ReadWrite|
|
|
163
|
+
|a3123d4e-4256-4ad0-bef0-205a00807fae|Application Calendars.Read|
|
|
164
|
+
|b92761c0-5311-4908-92ca-2c1f8c71aa1c|Application Calendars.ReadWrite|
|
|
165
|
+
|9b87c446-d3c1-4146-9d39-45ae63b4eeb7|Application Contacts.Read|
|
|
166
|
+
|265cabb3-13d9-4e05-b2cd-460cfa7ad3cc|Application Contacts.ReadWrite|
|
|
167
|
+
|b49ae303-7a8f-4ba1-aa37-27b40461aabb|Application Mail Full Access|
|
|
168
|
+
|48d6a78c-0681-4d73-acec-9f9ffad56ddb|Application Exchange Full Access|
|
|
169
|
+
|
|
170
|
+
More info about supported application roles: https://learn.microsoft.com/exchange/permissions-exo/application-rbac#supported-application-roles
|