@pnp/cli-microsoft365 7.8.0-beta.5ca5055 → 7.8.0-beta.5f64790
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +3 -3
- package/dist/index.js +13 -12
- package/dist/m365/commands/setup.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-add.js +4 -2
- package/dist/m365/outlook/commands/message/message-list.js +87 -17
- package/dist/m365/spo/commands/site/site-remove.js +128 -149
- package/dist/utils/urlUtil.js +8 -0
- package/docs/docs/cmd/entra/m365group/m365group-add.mdx +24 -24
- package/docs/docs/cmd/outlook/message/message-list.mdx +18 -6
- package/docs/docs/cmd/spo/site/site-remove.mdx +9 -19
- package/package.json +1 -1
|
@@ -3,18 +3,17 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoSiteRemoveCommand_instances, _SpoSiteRemoveCommand_initTelemetry, _SpoSiteRemoveCommand_initOptions, _SpoSiteRemoveCommand_initValidators;
|
|
7
|
-
import chalk from 'chalk';
|
|
6
|
+
var _SpoSiteRemoveCommand_instances, _SpoSiteRemoveCommand_initTelemetry, _SpoSiteRemoveCommand_initOptions, _SpoSiteRemoveCommand_initValidators, _SpoSiteRemoveCommand_initTypes;
|
|
8
7
|
import { cli } from '../../../../cli/cli.js';
|
|
9
|
-
import config from '../../../../config.js';
|
|
10
8
|
import request from '../../../../request.js';
|
|
11
|
-
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
12
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
13
|
-
import { spo } from '../../../../utils/spo.js';
|
|
14
10
|
import { validation } from '../../../../utils/validation.js';
|
|
15
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
16
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { odata } from '../../../../utils/odata.js';
|
|
14
|
+
import { spo } from '../../../../utils/spo.js';
|
|
17
15
|
import { setTimeout } from 'timers/promises';
|
|
16
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
18
17
|
class SpoSiteRemoveCommand extends SpoCommand {
|
|
19
18
|
get name() {
|
|
20
19
|
return commands.SITE_REMOVE;
|
|
@@ -25,217 +24,180 @@ class SpoSiteRemoveCommand extends SpoCommand {
|
|
|
25
24
|
constructor() {
|
|
26
25
|
super();
|
|
27
26
|
_SpoSiteRemoveCommand_instances.add(this);
|
|
27
|
+
this.pollingInterval = 5000;
|
|
28
28
|
__classPrivateFieldGet(this, _SpoSiteRemoveCommand_instances, "m", _SpoSiteRemoveCommand_initTelemetry).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _SpoSiteRemoveCommand_instances, "m", _SpoSiteRemoveCommand_initOptions).call(this);
|
|
30
30
|
__classPrivateFieldGet(this, _SpoSiteRemoveCommand_instances, "m", _SpoSiteRemoveCommand_initValidators).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoSiteRemoveCommand_instances, "m", _SpoSiteRemoveCommand_initTypes).call(this);
|
|
31
32
|
}
|
|
32
33
|
async commandAction(logger, args) {
|
|
34
|
+
if (args.options.wait) {
|
|
35
|
+
await this.warn(logger, `Option 'wait' is deprecated and will be removed in the next major release.`);
|
|
36
|
+
}
|
|
33
37
|
if (args.options.force) {
|
|
34
|
-
await this.removeSite(logger, args);
|
|
38
|
+
await this.removeSite(logger, args.options);
|
|
35
39
|
}
|
|
36
40
|
else {
|
|
37
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the site ${args.options.url}?` });
|
|
41
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the site '${args.options.url}'?` });
|
|
38
42
|
if (result) {
|
|
39
|
-
await this.removeSite(logger, args);
|
|
43
|
+
await this.removeSite(logger, args.options);
|
|
40
44
|
}
|
|
41
45
|
}
|
|
42
46
|
}
|
|
43
|
-
async removeSite(logger,
|
|
47
|
+
async removeSite(logger, options) {
|
|
44
48
|
try {
|
|
45
|
-
if (
|
|
46
|
-
await
|
|
49
|
+
if (this.verbose) {
|
|
50
|
+
await logger.logToStderr(`Removing site '${options.url}'...`);
|
|
47
51
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
this.spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
53
|
+
const siteUrl = urlUtil.removeTrailingSlashes(options.url);
|
|
54
|
+
const siteDetails = await this.getSiteDetails(logger, siteUrl);
|
|
55
|
+
const isGroupSite = siteDetails.GroupId && siteDetails.GroupId !== '00000000-0000-0000-0000-000000000000';
|
|
56
|
+
if (options.fromRecycleBin) {
|
|
57
|
+
if (!siteDetails.TimeDeleted) {
|
|
58
|
+
throw `Site is currently not in the recycle bin. Remove --fromRecycleBin if you want to remove it as active site.`;
|
|
55
59
|
}
|
|
56
|
-
|
|
57
|
-
if (this.
|
|
58
|
-
await logger.logToStderr(`
|
|
60
|
+
if (isGroupSite) {
|
|
61
|
+
if (this.verbose) {
|
|
62
|
+
await logger.logToStderr(`Checking if group '${siteDetails.GroupId}' is already permanently deleted from recycle bin.`);
|
|
59
63
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
await logger.logToStderr(chalk.yellow(`Entered site is a groupified site. Hence, the parameters 'skipRecycleBin' and 'wait' will not be applicable.`));
|
|
64
|
-
}
|
|
65
|
-
await this.deleteGroup(group.id, logger);
|
|
66
|
-
await this.deleteSite(args.options.url, args.options.wait, logger);
|
|
64
|
+
const isGroupInRecycleBin = await this.isGroupInEntraRecycleBin(logger, siteDetails.GroupId);
|
|
65
|
+
if (isGroupInRecycleBin) {
|
|
66
|
+
await this.removeGroupFromEntraRecycleBin(logger, siteDetails.GroupId);
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
68
|
+
}
|
|
69
|
+
await this.deleteSiteFromSharePointRecycleBin(logger, siteUrl);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
if (siteDetails.TimeDeleted) {
|
|
73
|
+
throw `Site is already in the recycle bin. Use --fromRecycleBin to permanently delete it.`;
|
|
74
|
+
}
|
|
75
|
+
if (isGroupSite) {
|
|
76
|
+
await this.deleteGroupifiedSite(logger, siteUrl);
|
|
77
|
+
if (options.skipRecycleBin) {
|
|
78
|
+
let isGroupInRecycleBin = await this.isGroupInEntraRecycleBin(logger, siteDetails.GroupId);
|
|
79
|
+
let amountOfPolls = 0;
|
|
80
|
+
while (!isGroupInRecycleBin && amountOfPolls < 20) {
|
|
81
|
+
await setTimeout(this.pollingInterval);
|
|
82
|
+
isGroupInRecycleBin = await this.isGroupInEntraRecycleBin(logger, siteDetails.GroupId);
|
|
83
|
+
amountOfPolls++;
|
|
81
84
|
}
|
|
82
|
-
|
|
83
|
-
|
|
85
|
+
if (isGroupInRecycleBin) {
|
|
86
|
+
await this.removeGroupFromEntraRecycleBin(logger, siteDetails.GroupId);
|
|
84
87
|
}
|
|
85
88
|
}
|
|
86
89
|
}
|
|
90
|
+
else {
|
|
91
|
+
await this.deleteNonGroupSite(logger, siteUrl);
|
|
92
|
+
}
|
|
93
|
+
if (options.skipRecycleBin) {
|
|
94
|
+
await this.deleteSiteFromSharePointRecycleBin(logger, siteUrl);
|
|
95
|
+
}
|
|
87
96
|
}
|
|
88
97
|
}
|
|
89
98
|
catch (err) {
|
|
90
|
-
this.
|
|
99
|
+
this.handleRejectedODataJsonPromise(err);
|
|
91
100
|
}
|
|
92
101
|
}
|
|
93
|
-
|
|
102
|
+
async removeGroupFromEntraRecycleBin(logger, groupId) {
|
|
103
|
+
if (this.verbose) {
|
|
104
|
+
await logger.logToStderr(`Permanently deleting group '${groupId}'.`);
|
|
105
|
+
}
|
|
94
106
|
const requestOptions = {
|
|
95
|
-
url: `https://graph.microsoft.com/v1.0/directory/deletedItems/Microsoft.Graph.Group
|
|
107
|
+
url: `https://graph.microsoft.com/v1.0/directory/deletedItems/Microsoft.Graph.Group/${groupId}`,
|
|
96
108
|
headers: {
|
|
97
109
|
accept: 'application/json;odata.metadata=none'
|
|
98
110
|
},
|
|
99
111
|
responseType: 'json'
|
|
100
112
|
};
|
|
101
|
-
return request.
|
|
113
|
+
return request.delete(requestOptions);
|
|
102
114
|
}
|
|
103
|
-
async
|
|
104
|
-
|
|
115
|
+
async isGroupInEntraRecycleBin(logger, groupId) {
|
|
116
|
+
if (this.verbose) {
|
|
117
|
+
await logger.logToStderr(`Checking if group '${groupId}' is in the Microsoft Entra recycle bin.`);
|
|
118
|
+
}
|
|
105
119
|
const requestOptions = {
|
|
106
|
-
url:
|
|
120
|
+
url: `https://graph.microsoft.com/v1.0/directory/deletedItems/Microsoft.Graph.Group/${groupId}?$select=id`,
|
|
107
121
|
headers: {
|
|
108
|
-
|
|
109
|
-
accept: 'application/json;odata=nometadata'
|
|
122
|
+
accept: 'application/json;odata.metadata=none'
|
|
110
123
|
},
|
|
111
124
|
responseType: 'json'
|
|
112
125
|
};
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
this.spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
117
|
-
this.context = await spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
118
|
-
if (args.options.fromRecycleBin) {
|
|
119
|
-
if (this.verbose) {
|
|
120
|
-
await logger.logToStderr(`Deleting site from recycle bin ${args.options.url}...`);
|
|
121
|
-
}
|
|
122
|
-
await this.deleteSiteFromTheRecycleBin(args.options.url, args.options.wait, logger);
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
await this.deleteSite(args.options.url, args.options.wait, logger);
|
|
126
|
+
try {
|
|
127
|
+
await request.get(requestOptions);
|
|
128
|
+
return true;
|
|
126
129
|
}
|
|
127
|
-
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
+
catch (err) {
|
|
131
|
+
if (err.response?.status === 404) {
|
|
132
|
+
return false;
|
|
130
133
|
}
|
|
131
|
-
|
|
134
|
+
throw err;
|
|
132
135
|
}
|
|
133
136
|
}
|
|
134
|
-
async
|
|
135
|
-
this.context = await spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
137
|
+
async deleteNonGroupSite(logger, siteUrl) {
|
|
136
138
|
if (this.verbose) {
|
|
137
|
-
await logger.logToStderr(`Deleting site
|
|
139
|
+
await logger.logToStderr(`Deleting site.`);
|
|
138
140
|
}
|
|
139
141
|
const requestOptions = {
|
|
140
|
-
url: `${this.spoAdminUrl}/
|
|
142
|
+
url: `${this.spoAdminUrl}/_api/Microsoft.Online.SharePoint.TenantAdministration.Tenant/RemoveSite`,
|
|
141
143
|
headers: {
|
|
142
|
-
'
|
|
144
|
+
accept: 'application/json;odata=nometadata'
|
|
143
145
|
},
|
|
144
|
-
data:
|
|
145
|
-
|
|
146
|
-
const response = await request.post(requestOptions);
|
|
147
|
-
const json = JSON.parse(response);
|
|
148
|
-
const responseContent = json[0];
|
|
149
|
-
if (responseContent.ErrorInfo) {
|
|
150
|
-
throw responseContent.ErrorInfo.ErrorMessage;
|
|
151
|
-
}
|
|
152
|
-
const operation = json[json.length - 1];
|
|
153
|
-
const isComplete = operation.IsComplete;
|
|
154
|
-
if (!wait || isComplete) {
|
|
155
|
-
return;
|
|
156
|
-
}
|
|
157
|
-
await setTimeout(operation.PollingInterval);
|
|
158
|
-
await spo.waitUntilFinished({
|
|
159
|
-
operationId: JSON.stringify(operation._ObjectIdentity_),
|
|
160
|
-
siteUrl: this.spoAdminUrl,
|
|
161
|
-
logger,
|
|
162
|
-
currentContext: this.context,
|
|
163
|
-
debug: this.debug,
|
|
164
|
-
verbose: this.verbose
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
async deleteSiteFromTheRecycleBin(url, wait, logger) {
|
|
168
|
-
this.context = await spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
169
|
-
const requestOptions = {
|
|
170
|
-
url: `${this.spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
171
|
-
headers: {
|
|
172
|
-
'X-RequestDigest': this.context.FormDigestValue
|
|
146
|
+
data: {
|
|
147
|
+
siteUrl: siteUrl
|
|
173
148
|
},
|
|
174
|
-
|
|
149
|
+
responseType: 'json'
|
|
175
150
|
};
|
|
176
|
-
|
|
177
|
-
const json = JSON.parse(response);
|
|
178
|
-
const responseContent = json[0];
|
|
179
|
-
if (responseContent.ErrorInfo) {
|
|
180
|
-
throw responseContent.ErrorInfo.ErrorMessage;
|
|
181
|
-
}
|
|
182
|
-
const operation = json[json.length - 1];
|
|
183
|
-
const isComplete = operation.IsComplete;
|
|
184
|
-
if (!wait || isComplete) {
|
|
185
|
-
return;
|
|
186
|
-
}
|
|
187
|
-
await setTimeout(operation.PollingInterval);
|
|
188
|
-
await spo.waitUntilFinished({
|
|
189
|
-
operationId: JSON.stringify(operation._ObjectIdentity_),
|
|
190
|
-
siteUrl: this.spoAdminUrl,
|
|
191
|
-
logger,
|
|
192
|
-
currentContext: this.context,
|
|
193
|
-
debug: this.debug,
|
|
194
|
-
verbose: this.verbose
|
|
195
|
-
});
|
|
151
|
+
return request.post(requestOptions);
|
|
196
152
|
}
|
|
197
|
-
async
|
|
198
|
-
this.spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
199
|
-
this.context = await spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
153
|
+
async deleteSiteFromSharePointRecycleBin(logger, url) {
|
|
200
154
|
if (this.verbose) {
|
|
201
|
-
await logger.logToStderr(`
|
|
155
|
+
await logger.logToStderr(`Permanently deleting site from the recycle bin.`);
|
|
202
156
|
}
|
|
203
157
|
const requestOptions = {
|
|
204
|
-
url: `${this.spoAdminUrl}/
|
|
158
|
+
url: `${this.spoAdminUrl}/_api/Microsoft.Online.SharePoint.TenantAdministration.Tenant/RemoveDeletedSite`,
|
|
205
159
|
headers: {
|
|
206
|
-
'
|
|
160
|
+
accept: 'application/json;odata=nometadata',
|
|
161
|
+
'Content-Type': 'application/json'
|
|
207
162
|
},
|
|
208
|
-
data:
|
|
163
|
+
data: {
|
|
164
|
+
siteUrl: url
|
|
165
|
+
},
|
|
166
|
+
responseType: 'json'
|
|
209
167
|
};
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (
|
|
214
|
-
|
|
168
|
+
return request.post(requestOptions);
|
|
169
|
+
}
|
|
170
|
+
async getSiteDetails(logger, url) {
|
|
171
|
+
if (this.verbose) {
|
|
172
|
+
await logger.logToStderr(`Retrieving site info.`);
|
|
215
173
|
}
|
|
216
|
-
const
|
|
217
|
-
|
|
174
|
+
const sites = await odata.getAllItems(`${this.spoAdminUrl}/_api/web/lists/GetByTitle('DO_NOT_DELETE_SPLIST_TENANTADMIN_AGGREGATED_SITECOLLECTIONS')/items?$filter=SiteUrl eq '${formatting.encodeQueryParameter(url)}'&$select=GroupId,TimeDeleted,SiteId`);
|
|
175
|
+
if (sites.length === 0) {
|
|
176
|
+
throw `Site not found in the tenant.`;
|
|
177
|
+
}
|
|
178
|
+
return sites[0];
|
|
218
179
|
}
|
|
219
|
-
async
|
|
180
|
+
async deleteGroupifiedSite(logger, siteUrl) {
|
|
220
181
|
if (this.verbose) {
|
|
221
|
-
await logger.logToStderr(`Removing
|
|
182
|
+
await logger.logToStderr(`Removing groupified site.`);
|
|
222
183
|
}
|
|
223
184
|
const requestOptions = {
|
|
224
|
-
url:
|
|
185
|
+
url: `${this.spoAdminUrl}/_api/GroupSiteManager/Delete?siteUrl='${formatting.encodeQueryParameter(siteUrl)}'`,
|
|
225
186
|
headers: {
|
|
226
|
-
|
|
227
|
-
}
|
|
187
|
+
accept: 'application/json;odata=nometadata'
|
|
188
|
+
},
|
|
189
|
+
responseType: 'json'
|
|
228
190
|
};
|
|
229
|
-
return request.
|
|
191
|
+
return request.post(requestOptions);
|
|
230
192
|
}
|
|
231
193
|
}
|
|
232
194
|
_SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelemetry = function _SpoSiteRemoveCommand_initTelemetry() {
|
|
233
195
|
this.telemetry.push((args) => {
|
|
234
196
|
Object.assign(this.telemetryProperties, {
|
|
235
|
-
skipRecycleBin:
|
|
236
|
-
fromRecycleBin:
|
|
237
|
-
wait: args.options.wait,
|
|
238
|
-
force:
|
|
197
|
+
skipRecycleBin: !!args.options.skipRecycleBin,
|
|
198
|
+
fromRecycleBin: !!args.options.fromRecycleBin,
|
|
199
|
+
wait: !!args.options.wait,
|
|
200
|
+
force: !!args.options.force
|
|
239
201
|
});
|
|
240
202
|
});
|
|
241
203
|
}, _SpoSiteRemoveCommand_initOptions = function _SpoSiteRemoveCommand_initOptions() {
|
|
@@ -251,7 +213,24 @@ _SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelem
|
|
|
251
213
|
option: '-f, --force'
|
|
252
214
|
});
|
|
253
215
|
}, _SpoSiteRemoveCommand_initValidators = function _SpoSiteRemoveCommand_initValidators() {
|
|
254
|
-
this.validators.push(async (args) =>
|
|
216
|
+
this.validators.push(async (args) => {
|
|
217
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.url);
|
|
218
|
+
if (isValidSharePointUrl !== true) {
|
|
219
|
+
return isValidSharePointUrl;
|
|
220
|
+
}
|
|
221
|
+
const uri = new URL(args.options.url);
|
|
222
|
+
const rootUrl = `${uri.protocol}//${uri.hostname}`;
|
|
223
|
+
if (rootUrl.toLowerCase() === urlUtil.removeTrailingSlashes(args.options.url.toLowerCase())) {
|
|
224
|
+
return `The root site cannot be deleted.`;
|
|
225
|
+
}
|
|
226
|
+
if (args.options.fromRecycleBin && args.options.skipRecycleBin) {
|
|
227
|
+
return 'Specify either fromRecycleBin or skipRecycleBin, but not both.';
|
|
228
|
+
}
|
|
229
|
+
return true;
|
|
230
|
+
});
|
|
231
|
+
}, _SpoSiteRemoveCommand_initTypes = function _SpoSiteRemoveCommand_initTypes() {
|
|
232
|
+
this.types.string.push('url');
|
|
233
|
+
this.types.boolean.push('skipRecycleBin', 'fromRecycleBin', 'wait', 'force');
|
|
255
234
|
};
|
|
256
235
|
export default new SpoSiteRemoveCommand();
|
|
257
236
|
//# sourceMappingURL=site-remove.js.map
|
package/dist/utils/urlUtil.js
CHANGED
|
@@ -197,6 +197,14 @@ export const urlUtil = {
|
|
|
197
197
|
const rootUrl = new URL(fullUrl);
|
|
198
198
|
return rootUrl.origin;
|
|
199
199
|
}
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* Removes trailing slashes from the URL.
|
|
203
|
+
* @param url The URL to process.
|
|
204
|
+
* @returns The URL without trailing slashes.
|
|
205
|
+
*/
|
|
206
|
+
removeTrailingSlashes(url) {
|
|
207
|
+
return url.replace(/\/+$/, '');
|
|
200
208
|
}
|
|
201
209
|
};
|
|
202
210
|
//# sourceMappingURL=urlUtil.js.map
|
|
@@ -22,37 +22,37 @@ m365 aad m365group add [options]
|
|
|
22
22
|
|
|
23
23
|
```md definition-list
|
|
24
24
|
`-n, --displayName <displayName>`
|
|
25
|
-
: Display name for the Microsoft 365 Group
|
|
26
|
-
|
|
27
|
-
`-d, --description <description>`
|
|
28
|
-
: Description for the Microsoft 365 Group
|
|
25
|
+
: Display name for the Microsoft 365 Group.
|
|
29
26
|
|
|
30
27
|
`-m, --mailNickname <mailNickname>`
|
|
31
|
-
: Name to use in the group e-mail (part before the `@`)
|
|
28
|
+
: Name to use in the group e-mail (part before the `@`).
|
|
29
|
+
|
|
30
|
+
`-d, --description [description]`
|
|
31
|
+
: Description for the Microsoft 365 Group.
|
|
32
32
|
|
|
33
33
|
`--owners [owners]`
|
|
34
|
-
: Comma-separated list of Microsoft 365 Group owners
|
|
34
|
+
: Comma-separated list of Microsoft 365 Group owners.
|
|
35
35
|
|
|
36
36
|
`--members [members]`
|
|
37
|
-
: Comma-separated list of Microsoft 365 Group members
|
|
37
|
+
: Comma-separated list of Microsoft 365 Group members.
|
|
38
38
|
|
|
39
39
|
`--visibility [visibility]`
|
|
40
40
|
: Specifies the group join policy and group content visibility for groups. Allowed values: `Private`, `Public`, or `HiddenMembership`. Defaults to `Public`.
|
|
41
41
|
|
|
42
42
|
`--allowMembersToPost [allowMembersToPost]`
|
|
43
|
-
: Set if only group members should be able to post conversations to the group
|
|
43
|
+
: Set if only group members should be able to post conversations to the group.
|
|
44
44
|
|
|
45
45
|
`--hideGroupInOutlook [hideGroupInOutlook]`
|
|
46
|
-
: Set to hide the group in Outlook experiences
|
|
46
|
+
: Set to hide the group in Outlook experiences.
|
|
47
47
|
|
|
48
48
|
`--subscribeNewGroupMembers [subscribeNewGroupMembers]`
|
|
49
|
-
: Set to subscribe all new group members to receive group conversation emails when new messages are posted in the group
|
|
49
|
+
: Set to subscribe all new group members to receive group conversation emails when new messages are posted in the group.
|
|
50
50
|
|
|
51
51
|
`--welcomeEmailDisabled [welcomeEmailDisabled]`
|
|
52
|
-
: Set to not send welcome emails to new group members
|
|
52
|
+
: Set to not send welcome emails to new group members.
|
|
53
53
|
|
|
54
54
|
`-l, --logoPath [logoPath]`
|
|
55
|
-
: Local path to the image file to use as group logo
|
|
55
|
+
: Local path to the image file to use as group logo.
|
|
56
56
|
```
|
|
57
57
|
|
|
58
58
|
<Global />
|
|
@@ -74,25 +74,25 @@ HiddenMembership | Owner permission is needed to join the group. Guest users can
|
|
|
74
74
|
|
|
75
75
|
## Examples
|
|
76
76
|
|
|
77
|
-
Create a public Microsoft 365 Group
|
|
77
|
+
Create a public Microsoft 365 Group.
|
|
78
78
|
|
|
79
79
|
```sh
|
|
80
|
-
m365 entra m365group add --displayName Finance --
|
|
80
|
+
m365 entra m365group add --displayName Finance --mailNickname finance
|
|
81
81
|
```
|
|
82
82
|
|
|
83
|
-
Create a private Microsoft 365 Group
|
|
83
|
+
Create a private Microsoft 365 Group.
|
|
84
84
|
|
|
85
85
|
```sh
|
|
86
|
-
m365 entra m365group add --displayName Finance --
|
|
86
|
+
m365 entra m365group add --displayName Finance --mailNickname finance --visibility Private
|
|
87
87
|
```
|
|
88
88
|
|
|
89
|
-
Create a public Microsoft 365 Group and set specified users as its owners
|
|
89
|
+
Create a public Microsoft 365 Group with description and set specified users as its owners.
|
|
90
90
|
|
|
91
91
|
```sh
|
|
92
92
|
m365 entra m365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --owners "DebraB@contoso.onmicrosoft.com,DiegoS@contoso.onmicrosoft.com"
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
Create a public Microsoft 365 Group and set specified users as its members
|
|
95
|
+
Create a public Microsoft 365 Group with description and set specified users as its members.
|
|
96
96
|
|
|
97
97
|
```sh
|
|
98
98
|
m365 entra m365group add --displayName Finance --description "This is the Contoso Finance Group. Please come here and check out the latest news, posts, files, and more." --mailNickname finance --members "DebraB@contoso.onmicrosoft.com,DiegoS@contoso.onmicrosoft.com"
|
|
@@ -101,31 +101,31 @@ m365 entra m365group add --displayName Finance --description "This is the Contos
|
|
|
101
101
|
Create a public Microsoft 365 Group and allow only group members to be able to post conversations to the group.
|
|
102
102
|
|
|
103
103
|
```sh
|
|
104
|
-
m365 entra m365group add --displayName Finance --
|
|
104
|
+
m365 entra m365group add --displayName Finance --mailNickname finance --allowMembersToPost
|
|
105
105
|
```
|
|
106
106
|
|
|
107
107
|
Create a public Microsoft 365 Group and hide it from the Outlook experiences (web and client).
|
|
108
108
|
|
|
109
109
|
```sh
|
|
110
|
-
m365 entra m365group add --displayName Finance --
|
|
110
|
+
m365 entra m365group add --displayName Finance --mailNickname finance --hideGroupInOutlook
|
|
111
111
|
```
|
|
112
112
|
|
|
113
113
|
Create a public Microsoft 365 Group and subscribe all new group members to receive group conversation emails when new messages are posted in the group.
|
|
114
114
|
|
|
115
115
|
```sh
|
|
116
|
-
m365 entra m365group add --displayName Finance --
|
|
116
|
+
m365 entra m365group add --displayName Finance --mailNickname finance --subscribeNewGroupMembers
|
|
117
117
|
```
|
|
118
118
|
|
|
119
119
|
Create a public Microsoft 365 Group and set to not send welcome emails to new group members.
|
|
120
120
|
|
|
121
121
|
```sh
|
|
122
|
-
m365 entra m365group add --displayName Finance --
|
|
122
|
+
m365 entra m365group add --displayName Finance --mailNickname finance --welcomeEmailDisabled
|
|
123
123
|
```
|
|
124
124
|
|
|
125
|
-
Create a public Microsoft 365 Group and set its logo
|
|
125
|
+
Create a public Microsoft 365 Group and set its logo.
|
|
126
126
|
|
|
127
127
|
```sh
|
|
128
|
-
m365 entra m365group add --displayName Finance --
|
|
128
|
+
m365 entra m365group add --displayName Finance --mailNickname finance --logoPath images/logo.png
|
|
129
129
|
```
|
|
130
130
|
|
|
131
131
|
## Response
|
|
@@ -20,28 +20,40 @@ m365 outlook message list [options]
|
|
|
20
20
|
|
|
21
21
|
`--folderId [folderId]`
|
|
22
22
|
: ID of the folder from which to list messages.
|
|
23
|
+
|
|
24
|
+
`--startTime [startTime]`
|
|
25
|
+
: Time indicating the inclusive start of a time range when the message was received. This should be defined as a valid ISO 8601 string (2021-12-16T18:28:48.6964197Z).
|
|
26
|
+
|
|
27
|
+
`--endTime [endTime]`
|
|
28
|
+
: Time indicating the exclusive end of a time range when the message was received. This should be defined as a valid ISO 8601 string (2021-12-16T18:28:48.6964197Z).
|
|
29
|
+
|
|
30
|
+
`--userId [userId]`
|
|
31
|
+
: The Microsoft Entra user ID. Specify either `userId` or `userName`, not both. This option is required when using application permissions.
|
|
32
|
+
|
|
33
|
+
`--userName [userName]`
|
|
34
|
+
: User principal name of the user. Specify either `userId` or `userName`, not both. This option is required when using application permissions.
|
|
23
35
|
```
|
|
24
36
|
|
|
25
37
|
<Global />
|
|
26
38
|
|
|
27
39
|
## Examples
|
|
28
40
|
|
|
29
|
-
List all messages
|
|
41
|
+
List all messages from a folder with the specified name received within a specific time frame.
|
|
30
42
|
|
|
31
43
|
```sh
|
|
32
|
-
m365 outlook message list --folderName Archive
|
|
44
|
+
m365 outlook message list --folderName Archive --startTime 2023-12-16T18:28:48.6964197Z --endTime 2024-02-01
|
|
33
45
|
```
|
|
34
46
|
|
|
35
|
-
List all messages
|
|
47
|
+
List all messages from a specific folder of a user specified by ID.
|
|
36
48
|
|
|
37
49
|
```sh
|
|
38
|
-
m365 outlook message list --folderId AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAAuAAAAAAAiQ8W967B7TKBjgx9rVEURAQAiIsqMbYjsT5e-T7KzowPTAAAAAAFNAAA=
|
|
50
|
+
m365 outlook message list --folderId AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAAuAAAAAAAiQ8W967B7TKBjgx9rVEURAQAiIsqMbYjsT5e-T7KzowPTAAAAAAFNAAA= --userId 48d31887-5fad-4d73-a9f5-3c356e68a038
|
|
39
51
|
```
|
|
40
52
|
|
|
41
|
-
List all messages
|
|
53
|
+
List all messages from a folder of a user specified by UPN.
|
|
42
54
|
|
|
43
55
|
```sh
|
|
44
|
-
m365 outlook message list --folderName inbox
|
|
56
|
+
m365 outlook message list --folderName inbox --userName john@contoso.com
|
|
45
57
|
```
|
|
46
58
|
|
|
47
59
|
## Response
|
|
@@ -14,63 +14,53 @@ m365 spo site remove [options]
|
|
|
14
14
|
|
|
15
15
|
```md definition-list
|
|
16
16
|
`-u, --url <url>`
|
|
17
|
-
: URL of the site
|
|
17
|
+
: URL of the site.
|
|
18
18
|
|
|
19
19
|
`--skipRecycleBin`
|
|
20
|
-
: Set to directly remove the site without moving it to the
|
|
20
|
+
: Set to directly remove the site without moving it to the recycle bin.
|
|
21
21
|
|
|
22
22
|
`--fromRecycleBin`
|
|
23
|
-
: Set to remove the site from the
|
|
23
|
+
: Set to remove the site from the recycle bin.
|
|
24
24
|
|
|
25
25
|
`--wait`
|
|
26
|
-
: Wait for the site to be removed before completing the command
|
|
26
|
+
: (deprecated) Wait for the site to be removed before completing the command.
|
|
27
27
|
|
|
28
28
|
`-f, --force`
|
|
29
|
-
: Don't prompt for
|
|
29
|
+
: Don't prompt for confirmation.
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<Global />
|
|
33
33
|
|
|
34
34
|
## Remarks
|
|
35
35
|
|
|
36
|
-
Deleting a site collection is by default asynchronous and depending on the current state of Microsoft 365, might take up to few minutes. If you're building a script with steps that require the site to be fully deleted, you should use the `--wait` flag. When using this flag, the `spo site remove` command will keep running until it received confirmation from Microsoft 365 that the site has been fully deleted.
|
|
37
|
-
|
|
38
|
-
If the site which you have selected to remove is groupified (Modern Team Site) and group exists, flags `--skipRecycleBin` and `--wait` will not be applicable. If the linked group still exists in the deleted groups, the site won't be removed. If the linked group is permanently deleted, the site will be removed like any classic site (except that flag `--wait` only will still not be applicable).
|
|
39
|
-
|
|
40
36
|
If the argument `--fromRecycleBin` is passed, the selected site will be permanently removed even if it's a groupified one.
|
|
41
37
|
|
|
42
38
|
:::info
|
|
43
39
|
|
|
44
|
-
To use this command you
|
|
40
|
+
To use this command you must be a Global or SharePoint administrator.
|
|
45
41
|
|
|
46
42
|
:::
|
|
47
43
|
|
|
48
44
|
## Examples
|
|
49
45
|
|
|
50
|
-
Remove the specified site and place it in the
|
|
46
|
+
Remove the specified site and place it in the recycle bin.
|
|
51
47
|
|
|
52
48
|
```sh
|
|
53
49
|
m365 spo site remove --url https://contoso.sharepoint.com/sites/demosite
|
|
54
50
|
```
|
|
55
51
|
|
|
56
|
-
Remove the site without moving it to the
|
|
52
|
+
Remove the site without moving it to the recycle bin.
|
|
57
53
|
|
|
58
54
|
```sh
|
|
59
55
|
m365 spo site remove --url https://contoso.sharepoint.com/sites/demosite --skipRecycleBin
|
|
60
56
|
```
|
|
61
57
|
|
|
62
|
-
Remove the previously deleted site from the
|
|
58
|
+
Remove the previously deleted site from the recycle bin.
|
|
63
59
|
|
|
64
60
|
```sh
|
|
65
61
|
m365 spo site remove --url https://contoso.sharepoint.com/sites/demosite --fromRecycleBin
|
|
66
62
|
```
|
|
67
63
|
|
|
68
|
-
Remove the site without moving it to the Recycle Bin and wait for completion
|
|
69
|
-
|
|
70
|
-
```sh
|
|
71
|
-
m365 spo site remove --url https://contoso.sharepoint.com/sites/demosite --wait --skipRecycleBin
|
|
72
|
-
```
|
|
73
|
-
|
|
74
64
|
## Response
|
|
75
65
|
|
|
76
66
|
The command won't return a response on success.
|
package/package.json
CHANGED