@pnp/cli-microsoft365 7.5.0 → 7.6.0-beta.443bfd8
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 +3 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +10 -8
- package/dist/cli/cli.js +1 -1
- package/dist/m365/purview/commands/threatassessment/threatassessment-add.js +123 -0
- package/dist/m365/purview/commands/threatassessment/threatassessment-list.js +104 -0
- package/dist/m365/purview/commands.js +3 -1
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +111 -0
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-add.js +183 -0
- package/dist/m365/spfx/commands/project/project-azuredevops-pipeline-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +3 -4
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/user/user-remove.js +93 -16
- package/docs/docs/cmd/purview/threatassessment/threatassessment-add.mdx +131 -0
- package/docs/docs/cmd/purview/threatassessment/threatassessment-list.mdx +110 -0
- package/docs/docs/cmd/spfx/project/project-azuredevops-pipeline-add.mdx +87 -0
- package/docs/docs/cmd/spo/user/user-remove.mdx +40 -9
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
|
@@ -5,11 +5,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _SpoUserRemoveCommand_instances, _SpoUserRemoveCommand_initTelemetry, _SpoUserRemoveCommand_initOptions, _SpoUserRemoveCommand_initValidators, _SpoUserRemoveCommand_initOptionSets;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import { spo } from '../../../../utils/spo.js';
|
|
8
9
|
import request from '../../../../request.js';
|
|
10
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
11
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
12
|
import { validation } from '../../../../utils/validation.js';
|
|
11
13
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
14
|
import commands from '../../commands.js';
|
|
15
|
+
;
|
|
13
16
|
class SpoUserRemoveCommand extends SpoCommand {
|
|
14
17
|
get name() {
|
|
15
18
|
return commands.USER_REMOVE;
|
|
@@ -40,13 +43,58 @@ class SpoUserRemoveCommand extends SpoCommand {
|
|
|
40
43
|
if (this.verbose) {
|
|
41
44
|
await logger.logToStderr(`Removing user from subsite ${options.webUrl} ...`);
|
|
42
45
|
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
try {
|
|
47
|
+
let requestUrl = `${encodeURI(options.webUrl)}/_api/web/siteusers/`;
|
|
48
|
+
if (options.id) {
|
|
49
|
+
requestUrl += `removebyid(${options.id})`;
|
|
50
|
+
}
|
|
51
|
+
else if (options.loginName) {
|
|
52
|
+
requestUrl += `removeByLoginName('${formatting.encodeQueryParameter(options.loginName)}')`;
|
|
53
|
+
}
|
|
54
|
+
else if (options.email) {
|
|
55
|
+
const user = await spo.getUserByEmail(options.webUrl, options.email, logger, this.verbose);
|
|
56
|
+
requestUrl += `removebyid(${user.Id})`;
|
|
57
|
+
}
|
|
58
|
+
else if (options.userName) {
|
|
59
|
+
const user = await this.getUser(options);
|
|
60
|
+
if (!user) {
|
|
61
|
+
throw new Error(`User not found: ${options.userName}`);
|
|
62
|
+
}
|
|
63
|
+
if (this.verbose) {
|
|
64
|
+
await logger.logToStderr(`Removing user ${user.Title} ...`);
|
|
65
|
+
}
|
|
66
|
+
requestUrl += `removebyid(${user.Id})`;
|
|
67
|
+
}
|
|
68
|
+
else if (options.entraGroupId || options.entraGroupName) {
|
|
69
|
+
const entraGroup = await this.getEntraGroup(options);
|
|
70
|
+
if (this.verbose) {
|
|
71
|
+
await logger.logToStderr(`Removing entra group ${entraGroup?.displayName} ...`);
|
|
72
|
+
}
|
|
73
|
+
//for entra groups, M365 groups have an associated email and security groups don't
|
|
74
|
+
if (entraGroup?.mail) {
|
|
75
|
+
//M365 group is prefixed with c:0o.c|federateddirectoryclaimprovider
|
|
76
|
+
requestUrl += `removeByLoginName('c:0o.c|federateddirectoryclaimprovider|${entraGroup.id}')`;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
//security group is prefixed with c:0t.c|tenant
|
|
80
|
+
requestUrl += `removeByLoginName('c:0t.c|tenant|${entraGroup?.id}')`;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
const requestOptions = {
|
|
84
|
+
url: requestUrl,
|
|
85
|
+
headers: {
|
|
86
|
+
accept: 'application/json;odata=nometadata'
|
|
87
|
+
},
|
|
88
|
+
responseType: 'json'
|
|
89
|
+
};
|
|
90
|
+
await request.post(requestOptions);
|
|
46
91
|
}
|
|
47
|
-
|
|
48
|
-
|
|
92
|
+
catch (err) {
|
|
93
|
+
this.handleRejectedODataJsonPromise(err);
|
|
49
94
|
}
|
|
95
|
+
}
|
|
96
|
+
async getUser(options) {
|
|
97
|
+
const requestUrl = `${options.webUrl}/_api/web/siteusers?$filter=UserPrincipalName eq ('${formatting.encodeQueryParameter(options.userName)}')`;
|
|
50
98
|
const requestOptions = {
|
|
51
99
|
url: requestUrl,
|
|
52
100
|
headers: {
|
|
@@ -54,20 +102,23 @@ class SpoUserRemoveCommand extends SpoCommand {
|
|
|
54
102
|
},
|
|
55
103
|
responseType: 'json'
|
|
56
104
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
105
|
+
const userInstance = await request.get(requestOptions);
|
|
106
|
+
return userInstance.value[0];
|
|
107
|
+
}
|
|
108
|
+
async getEntraGroup(options) {
|
|
109
|
+
return options.entraGroupId ? await entraGroup.getGroupById(options.entraGroupId) : await entraGroup.getGroupByDisplayName(options.entraGroupName);
|
|
63
110
|
}
|
|
64
111
|
}
|
|
65
112
|
_SpoUserRemoveCommand_instances = new WeakSet(), _SpoUserRemoveCommand_initTelemetry = function _SpoUserRemoveCommand_initTelemetry() {
|
|
66
113
|
this.telemetry.push((args) => {
|
|
67
114
|
Object.assign(this.telemetryProperties, {
|
|
68
|
-
id:
|
|
69
|
-
loginName:
|
|
70
|
-
|
|
115
|
+
id: typeof args.options.id !== 'undefined',
|
|
116
|
+
loginName: typeof args.options.loginName !== 'undefined',
|
|
117
|
+
email: typeof args.options.email !== 'undefined',
|
|
118
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
119
|
+
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
120
|
+
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
121
|
+
force: !!args.options.force
|
|
71
122
|
});
|
|
72
123
|
});
|
|
73
124
|
}, _SpoUserRemoveCommand_initOptions = function _SpoUserRemoveCommand_initOptions() {
|
|
@@ -77,15 +128,41 @@ _SpoUserRemoveCommand_instances = new WeakSet(), _SpoUserRemoveCommand_initTelem
|
|
|
77
128
|
option: '-i, --id [id]'
|
|
78
129
|
}, {
|
|
79
130
|
option: '--loginName [loginName]'
|
|
131
|
+
}, {
|
|
132
|
+
option: '--email [email]'
|
|
133
|
+
}, {
|
|
134
|
+
option: '--userName [userName]'
|
|
135
|
+
}, {
|
|
136
|
+
option: '--entraGroupId [entraGroupId]'
|
|
137
|
+
}, {
|
|
138
|
+
option: '--entraGroupName [entraGroupName]'
|
|
80
139
|
}, {
|
|
81
140
|
option: '-f, --force'
|
|
82
141
|
});
|
|
83
142
|
}, _SpoUserRemoveCommand_initValidators = function _SpoUserRemoveCommand_initValidators() {
|
|
84
143
|
this.validators.push(async (args) => {
|
|
85
|
-
|
|
144
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
145
|
+
if (isValidSharePointUrl !== true) {
|
|
146
|
+
return isValidSharePointUrl;
|
|
147
|
+
}
|
|
148
|
+
if (args.options.id && isNaN(parseInt(args.options.id))) {
|
|
149
|
+
return `Specified id ${args.options.id} is not a number`;
|
|
150
|
+
}
|
|
151
|
+
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
152
|
+
return `${args.options.entraId} is not a valid GUID.`;
|
|
153
|
+
}
|
|
154
|
+
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
155
|
+
return `${args.options.userName} is not a valid userName.`;
|
|
156
|
+
}
|
|
157
|
+
if (args.options.email && !validation.isValidUserPrincipalName(args.options.email)) {
|
|
158
|
+
return `${args.options.email} is not a valid email.`;
|
|
159
|
+
}
|
|
160
|
+
return true;
|
|
86
161
|
});
|
|
87
162
|
}, _SpoUserRemoveCommand_initOptionSets = function _SpoUserRemoveCommand_initOptionSets() {
|
|
88
|
-
this.optionSets.push({
|
|
163
|
+
this.optionSets.push({
|
|
164
|
+
options: ['id', 'loginName', 'email', 'userName', 'entraGroupId', 'entraGroupName']
|
|
165
|
+
});
|
|
89
166
|
};
|
|
90
167
|
export default new SpoUserRemoveCommand();
|
|
91
168
|
//# sourceMappingURL=user-remove.js.map
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# purview threatassessment add
|
|
6
|
+
|
|
7
|
+
Create a threat assessment
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 purview threatassessment add [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-t, --type <type>`
|
|
19
|
+
: The type of threat assessment to retrieve. Supports `file` and `url`.
|
|
20
|
+
|
|
21
|
+
`-e, --expectedAssessment <expectedAssessment>`
|
|
22
|
+
: The expected assessment from submitter. Possible values are: `block` and `unblock`.
|
|
23
|
+
|
|
24
|
+
`-c, --category <category>`
|
|
25
|
+
: The threat category. Possible values are: `spam`, `phishing`, `malware`.
|
|
26
|
+
|
|
27
|
+
`-p, --path [path]`
|
|
28
|
+
: Local path to the file to upload. Can only be used for threat assessment with type `file`.
|
|
29
|
+
|
|
30
|
+
`-u, --url [url]`
|
|
31
|
+
: The URL string. Can only be used for threat assessment with type `url`.
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<Global />
|
|
35
|
+
|
|
36
|
+
## Remarks
|
|
37
|
+
|
|
38
|
+
:::info
|
|
39
|
+
|
|
40
|
+
This command currently only supports delegated permissions.
|
|
41
|
+
|
|
42
|
+
:::
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
|
|
46
|
+
Create a file threat assessment
|
|
47
|
+
|
|
48
|
+
```sh
|
|
49
|
+
m365 purview threatassessment add --type file --expectedAssessment block --category malware --fileName 'test.txt' --path 'C:\Path\To\File.txt'
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Create a url threat assessment
|
|
53
|
+
|
|
54
|
+
```sh
|
|
55
|
+
m365 purview threatassessment add --type url --expectedAssessment block --category phishing --url 'http://contoso.com'
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Response
|
|
59
|
+
|
|
60
|
+
<Tabs>
|
|
61
|
+
<TabItem value="JSON">
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"id": "b0e69f1c-adda-4df2-2906-08dc2caa6b3f",
|
|
66
|
+
"createdDateTime": "2024-02-13T15:42:43.5131654Z",
|
|
67
|
+
"contentType": "file",
|
|
68
|
+
"expectedAssessment": "block",
|
|
69
|
+
"category": "malware",
|
|
70
|
+
"status": "pending",
|
|
71
|
+
"requestSource": "administrator",
|
|
72
|
+
"fileName": "test.txt",
|
|
73
|
+
"contentData": "dGVzdC50eHQ=",
|
|
74
|
+
"createdBy": {
|
|
75
|
+
"user": {
|
|
76
|
+
"id": "fe36f75e-c103-410b-a18a-2bf6df06ac3a",
|
|
77
|
+
"displayName": "John Doe"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
</TabItem>
|
|
84
|
+
<TabItem value="Text">
|
|
85
|
+
|
|
86
|
+
```text
|
|
87
|
+
category : malware
|
|
88
|
+
contentData : dGVzdC50eHQ=
|
|
89
|
+
contentType : file
|
|
90
|
+
createdBy : {"user":{"id":"fe36f75e-c103-410b-a18a-2bf6df06ac3a","displayName":"John Doe"}}
|
|
91
|
+
createdDateTime : 2024-02-13T16:15:00.4125206Z
|
|
92
|
+
expectedAssessment: block
|
|
93
|
+
fileName : test.txt
|
|
94
|
+
id : be1223c4-4e92-4a4c-8c16-08dc2caeedba
|
|
95
|
+
requestSource : administrator
|
|
96
|
+
status : pending
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
</TabItem>
|
|
100
|
+
<TabItem value="CSV">
|
|
101
|
+
|
|
102
|
+
```csv
|
|
103
|
+
id,createdDateTime,contentType,expectedAssessment,category,status,requestSource,fileName,contentData
|
|
104
|
+
d31eb5f5-ecd5-4a8e-fb2a-08dc2caf00a8,2024-02-13T16:15:32.1741098Z,file,block,malware,pending,administrator,test.txt,dGVzdC50eHQ=
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
</TabItem>
|
|
108
|
+
<TabItem value="Markdown">
|
|
109
|
+
|
|
110
|
+
```md
|
|
111
|
+
# purview threatassessment add --type "file" --expectedAssessment "block" --category "malware" --path "C:\temp\test.txt"
|
|
112
|
+
|
|
113
|
+
Date: 13/02/2024
|
|
114
|
+
|
|
115
|
+
## e3524baf-6ea6-4fab-68af-08dc2caf0ae3
|
|
116
|
+
|
|
117
|
+
Property | Value
|
|
118
|
+
---------|-------
|
|
119
|
+
id | e3524baf-6ea6-4fab-68af-08dc2caf0ae3
|
|
120
|
+
createdDateTime | 2024-02-13T16:15:49.3342383Z
|
|
121
|
+
contentType | file
|
|
122
|
+
expectedAssessment | block
|
|
123
|
+
category | malware
|
|
124
|
+
status | pending
|
|
125
|
+
requestSource | administrator
|
|
126
|
+
fileName | test.txt
|
|
127
|
+
contentData | dGVzdC50eHQ=
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
</TabItem>
|
|
131
|
+
</Tabs>
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# purview threatassessment list
|
|
6
|
+
|
|
7
|
+
Get a list of threat assessments
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 purview threatassessment list [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-t, --type [type]`
|
|
19
|
+
: The type of threat assessment to retrieve. Allowed values are `mail`, `file`, `emailFile` and `url`.
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
<Global />
|
|
23
|
+
|
|
24
|
+
## Examples
|
|
25
|
+
|
|
26
|
+
Get a list of threat assessments
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
m365 purview threatassessment list
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Get a list of threat assessments of type _mail_
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
m365 purview threatassessment list --type mail
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Response
|
|
39
|
+
|
|
40
|
+
<Tabs>
|
|
41
|
+
<TabItem value="JSON">
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
[
|
|
45
|
+
{
|
|
46
|
+
"type": "mail",
|
|
47
|
+
"id": "49c5ef5b-1f65-444a-e6b9-08d772ea2059",
|
|
48
|
+
"createdDateTime": "2019-11-27T03:30:18.6890937Z",
|
|
49
|
+
"contentType": "mail",
|
|
50
|
+
"expectedAssessment": "block",
|
|
51
|
+
"category": "spam",
|
|
52
|
+
"status": "pending",
|
|
53
|
+
"requestSource": "administrator",
|
|
54
|
+
"recipientEmail": "john@contoso.onmicrosoft.com",
|
|
55
|
+
"destinationRoutingReason": "notJunk",
|
|
56
|
+
"messageUri": "https://graph.microsoft.com/v1.0/users/c52ce8db-3e4b-4181-93c4-7d6b6bffaf60/messages/AAMkADU3MWUxOTU0LWNlOTEt=",
|
|
57
|
+
"createdBy": {
|
|
58
|
+
"user": {
|
|
59
|
+
"id": "c52ce8db-3e4b-4181-93c4-7d6b6bffaf60",
|
|
60
|
+
"displayName": "John Doe"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
</TabItem>
|
|
68
|
+
<TabItem value="Text">
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
id type category
|
|
72
|
+
------------------------------------ ----------- --------
|
|
73
|
+
49c5ef5b-1f65-444a-e6b9-08d772ea2059 mail spam
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
</TabItem>
|
|
77
|
+
<TabItem value="CSV">
|
|
78
|
+
|
|
79
|
+
```csv
|
|
80
|
+
id,type,category
|
|
81
|
+
49c5ef5b-1f65-444a-e6b9-08d772ea2059,mail,spam
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
</TabItem>
|
|
85
|
+
<TabItem value="Markdown">
|
|
86
|
+
|
|
87
|
+
```md
|
|
88
|
+
# purview threatassessment list
|
|
89
|
+
|
|
90
|
+
Date: 16/2/2023
|
|
91
|
+
|
|
92
|
+
## a47e428c-a7bd-4cf2-f061-08db0f58b736
|
|
93
|
+
|
|
94
|
+
Property | Value
|
|
95
|
+
---------|-------
|
|
96
|
+
type | mail
|
|
97
|
+
id | 49c5ef5b-1f65-444a-e6b9-08d772ea2059
|
|
98
|
+
createdDateTime | 2019-11-27T03:30:18.6890937Z
|
|
99
|
+
contentType | mail
|
|
100
|
+
expectedAssessment | block
|
|
101
|
+
category | spam
|
|
102
|
+
status | pending
|
|
103
|
+
recipientEmail | john@contoso.onmicrosoft.com
|
|
104
|
+
destinationRoutingReason | notJunk
|
|
105
|
+
messageUri | https://graph.microsoft.com/v1.0/users/c52ce8db-3e4b-4181-93c4-7d6b6bffaf60/messages/AAMkADU3MWUxOTU0LWNlOTEt=
|
|
106
|
+
createdBy | {"user":{"id":"c52ce8db-3e4b-4181-93c4-7d6b6bffaf60","displayName":"John Doe"}}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
</TabItem>
|
|
110
|
+
</Tabs>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
|
|
3
|
+
# spfx project azuredevops pipeline add
|
|
4
|
+
|
|
5
|
+
Adds a Azure DevOps Pipeline for a SharePoint Framework project
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
m365 spfx project azuredevops pipeline add [options]
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Options
|
|
14
|
+
|
|
15
|
+
```md definition-list
|
|
16
|
+
`-n, --name [name]`
|
|
17
|
+
: Name of the pipeline run that will be created. If none is specified a default name generated by Azure DevOps will be used
|
|
18
|
+
|
|
19
|
+
`-b, --branchName [branchName]`
|
|
20
|
+
: Specify the branch name which should trigger the workflow on push. If none is specified a default will be used which is 'main'
|
|
21
|
+
|
|
22
|
+
`-l, --loginMethod [loginMethod]`
|
|
23
|
+
: Specify the login method used for the login action. Possible options are: `user`, `application`. Default `application`
|
|
24
|
+
|
|
25
|
+
`-s, --scope [scope]`
|
|
26
|
+
: Scope of the app catalog: `tenant`, `sitecollection`. Default is `tenant`
|
|
27
|
+
|
|
28
|
+
`-u, --siteUrl [siteUrl]`
|
|
29
|
+
: The URL of the site collection where the solution package will be added. Required if scope is set to `sitecollection`
|
|
30
|
+
|
|
31
|
+
`--skipFeatureDeployment`
|
|
32
|
+
: When specified the app will be added to all sites. When deployed to the site app catalog it will be added to all sub-sites of that site.
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
<Global />
|
|
36
|
+
|
|
37
|
+
## Remarks
|
|
38
|
+
|
|
39
|
+
The `spfx project azuredevops pipeline add` will create a workflow .yml file in the `.azuredevops/pipelines` directory in your project. If such directory does not exist the command will automatically create it.
|
|
40
|
+
|
|
41
|
+
The command will not create the Azure DevOps pipeline. You will need to manually create it in Azure DevOps. The command will only create the workflow file which you can then push to your repo and create a new yaml pipline based on it.
|
|
42
|
+
|
|
43
|
+
For the `application` login method the command does not register an Entra application nor does it create the required certificate. In order to proceed, obtain (create) a self-signed certificate and register a new Entra application with certificate authentication. After that you will need to fill the following variables, or what is more preferable, create a dedicated variable group to store those properties:
|
|
44
|
+
|
|
45
|
+
- `CertificateBase64Encoded` - base 64 encoded certificate. Use either `CertificateBase64Encoded` or `CertificateSecureFileId` but not both
|
|
46
|
+
- `CertificateSecureFileId` - id of a certificate file in the secure files section of the DevOps library. `.pfx` file. Use either `CertificateBase64Encoded` or `CertificateSecureFileId` but not both
|
|
47
|
+
- `CertificatePassword` - certificate password. This applies only if the certificate is encoded which is the recommended approach
|
|
48
|
+
- `EntraAppId` - client id of the registered Entra application
|
|
49
|
+
|
|
50
|
+
This use case is perfect in a production context as it does not create any dependencies on an account
|
|
51
|
+
|
|
52
|
+
For the `user` login method you will need to fill the following variables, or what is more preferable, create a dedicated variable group to store those properties:
|
|
53
|
+
|
|
54
|
+
- `UserName` - user email
|
|
55
|
+
- `Password` - password
|
|
56
|
+
|
|
57
|
+
This method is perfect to test your workflow, in a dev context, for personal usage. It will not work for accounts with MFA.
|
|
58
|
+
|
|
59
|
+
:::info
|
|
60
|
+
|
|
61
|
+
Run this command in the SPFx solution folder.
|
|
62
|
+
|
|
63
|
+
:::
|
|
64
|
+
|
|
65
|
+
## Examples
|
|
66
|
+
|
|
67
|
+
Adds an Azure DevOps Pipeline for a SharePoint Framework project triggered on push to main
|
|
68
|
+
|
|
69
|
+
```sh
|
|
70
|
+
m365 spfx project azuredevops pipeline add
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Adds an Azure DevOps Pipeline for a SharePoint Framework project with `user` login method triggered on push to main
|
|
74
|
+
|
|
75
|
+
```sh
|
|
76
|
+
m365 spfx project azuredevops pipeline add --loginMethod "user"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Adds an Azure DevOps Pipeline for a SharePoint Framework project with deployment to a site collection app catalog
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
m365 spfx project azuredevops pipeline add --scope "sitecollection" --siteUrl "https://some.sharepoint.com/sites/someSite"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Response
|
|
86
|
+
|
|
87
|
+
The command won't return a response on success.
|
|
@@ -14,13 +14,25 @@ m365 spo user remove [options]
|
|
|
14
14
|
|
|
15
15
|
```md definition-list
|
|
16
16
|
`-u, --webUrl <webUrl>`
|
|
17
|
-
: URL of the web to remove user
|
|
17
|
+
: URL of the web to remove user.
|
|
18
18
|
|
|
19
19
|
`--id [id]`
|
|
20
|
-
: ID of the user to remove from web
|
|
20
|
+
: ID of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
|
|
21
21
|
|
|
22
22
|
`--loginName [loginName]`
|
|
23
|
-
: Login name of the
|
|
23
|
+
: Login name of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
|
|
24
|
+
|
|
25
|
+
`--userName [userName]`
|
|
26
|
+
: User name of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
|
|
27
|
+
|
|
28
|
+
`--email [email]`
|
|
29
|
+
: Email of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
|
|
30
|
+
|
|
31
|
+
`--entraGroupId [entraGroupId]`
|
|
32
|
+
: Object ID of the Entra group ID to remove. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
|
|
33
|
+
|
|
34
|
+
`--entraGroupName [entraGroupName]`
|
|
35
|
+
: Name of the Entra group to remove. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
|
|
24
36
|
|
|
25
37
|
`-f, --force`
|
|
26
38
|
: Do not prompt for confirmation before removing user from web
|
|
@@ -28,24 +40,43 @@ m365 spo user remove [options]
|
|
|
28
40
|
|
|
29
41
|
<Global />
|
|
30
42
|
|
|
31
|
-
## Remarks
|
|
32
|
-
|
|
33
|
-
Use either `id` or `loginName`, but not both
|
|
34
|
-
|
|
35
43
|
## Examples
|
|
36
44
|
|
|
37
|
-
Removes user
|
|
45
|
+
Removes user by id from a web without prompting for confirmation
|
|
38
46
|
|
|
39
47
|
```sh
|
|
40
48
|
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --id 10 --force
|
|
41
49
|
```
|
|
42
50
|
|
|
43
|
-
Removes user
|
|
51
|
+
Removes user by loginName from a web
|
|
44
52
|
|
|
45
53
|
```sh
|
|
46
54
|
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --loginName "i:0#.f|membership|john.doe@mytenant.onmicrosoft.com"
|
|
47
55
|
```
|
|
48
56
|
|
|
57
|
+
Removes user by userName from a web
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --userName "john.doe_hotmail.com#ext#@mytenant.onmicrosoft.com"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Removes user by email from a web
|
|
64
|
+
|
|
65
|
+
```sh
|
|
66
|
+
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --email "john.doe@mytenant.onmicrosoft.com"
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
Removes user by entraGroupId from a web
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --entraGroupId f832a493-de73-4fef-87ed-8c6fffd91be6
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Removes user by entraGroupName from a web
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
m365 spo user remove --webUrl _https://contoso.sharepoint.com/sites/HR_ --entraGroupName "Test Members"
|
|
79
|
+
```
|
|
49
80
|
## Response
|
|
50
81
|
|
|
51
82
|
The command won't return a response on success.
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@pnp/cli-microsoft365",
|
|
9
|
-
"version": "7.
|
|
9
|
+
"version": "7.6.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@azure/msal-common": "^14.7.0",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnp/cli-microsoft365",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.6.0-beta.443bfd8",
|
|
4
4
|
"description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/api.js",
|
|
@@ -302,4 +302,4 @@
|
|
|
302
302
|
"sinon": "^17.0.0",
|
|
303
303
|
"source-map-support": "^0.5.21"
|
|
304
304
|
}
|
|
305
|
-
}
|
|
305
|
+
}
|