@pnp/cli-microsoft365 7.6.0-beta.480812d → 7.6.0-beta.79bc59c
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/m365/base/PeriodBasedReport.js +3 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +3 -0
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +3 -0
- package/dist/m365/teams/commands/report/report-pstncalls.js +3 -0
- package/dist/m365/teams/commands/team/team-add.js +132 -3
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +3 -0
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +3 -0
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +3 -0
- package/dist/utils/entraUser.js +36 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx +8 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx +8 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx +8 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +8 -0
- package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +8 -0
- package/docs/docs/cmd/onedrive/report/report-activityfilecounts.mdx +8 -0
- package/docs/docs/cmd/onedrive/report/report-activityusercounts.mdx +8 -0
- package/docs/docs/cmd/onedrive/report/report-activityuserdetail.mdx +8 -0
- package/docs/docs/cmd/onedrive/report/report-usageaccountcounts.mdx +8 -0
- package/docs/docs/cmd/onedrive/report/report-usageaccountdetail.mdx +8 -0
- package/docs/docs/cmd/onedrive/report/report-usagefilecounts.mdx +6 -0
- package/docs/docs/cmd/onedrive/report/report-usagestorage.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailactivitycounts.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.mdx +7 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.mdx +6 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.mdx +8 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.mdx +8 -0
- package/docs/docs/cmd/setup.mdx +2 -4
- package/docs/docs/cmd/skype/report/report-activitycounts.mdx +8 -0
- package/docs/docs/cmd/skype/report/report-activityusercounts.mdx +8 -0
- package/docs/docs/cmd/skype/report/report-activityuserdetail.mdx +8 -0
- package/docs/docs/cmd/spo/report/report-activityfilecounts.mdx +8 -0
- package/docs/docs/cmd/spo/report/report-activitypages.mdx +8 -0
- package/docs/docs/cmd/spo/report/report-activityusercounts.mdx +6 -0
- package/docs/docs/cmd/spo/report/report-activityuserdetail.mdx +6 -0
- package/docs/docs/cmd/spo/report/report-siteusagedetail.mdx +6 -0
- package/docs/docs/cmd/spo/report/report-siteusagefilecounts.mdx +6 -0
- package/docs/docs/cmd/spo/report/report-siteusagepages.mdx +8 -0
- package/docs/docs/cmd/spo/report/report-siteusagesitecounts.mdx +6 -0
- package/docs/docs/cmd/spo/report/report-siteusagestorage.mdx +8 -0
- package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.mdx +8 -0
- package/docs/docs/cmd/teams/report/report-deviceusageusercounts.mdx +8 -0
- package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.mdx +6 -0
- package/docs/docs/cmd/teams/report/report-directroutingcalls.mdx +6 -0
- package/docs/docs/cmd/teams/report/report-pstncalls.mdx +6 -0
- package/docs/docs/cmd/teams/report/report-useractivitycounts.mdx +8 -0
- package/docs/docs/cmd/teams/report/report-useractivityusercounts.mdx +8 -0
- package/docs/docs/cmd/teams/report/report-useractivityuserdetail.mdx +8 -0
- package/docs/docs/cmd/teams/team/team-add.mdx +28 -4
- package/docs/docs/cmd/tenant/report/report-activeusercounts.mdx +8 -0
- package/docs/docs/cmd/tenant/report/report-activeuserdetail.mdx +6 -0
- package/docs/docs/cmd/tenant/report/report-office365activationcounts.mdx +8 -0
- package/docs/docs/cmd/tenant/report/report-office365activationsusercounts.mdx +8 -0
- package/docs/docs/cmd/tenant/report/report-office365activationsuserdetail.mdx +8 -0
- package/docs/docs/cmd/tenant/report/report-servicesusercounts.mdx +8 -0
- package/docs/docs/cmd/viva/engage/engage-report-activitycounts.mdx +8 -0
- package/docs/docs/cmd/viva/engage/engage-report-activityusercounts.mdx +8 -0
- package/docs/docs/cmd/viva/engage/engage-report-activityuserdetail.mdx +6 -0
- package/docs/docs/cmd/viva/engage/engage-report-deviceusagedistributionusercounts.mdx +8 -0
- package/docs/docs/cmd/viva/engage/engage-report-deviceusageusercounts.mdx +8 -0
- package/docs/docs/cmd/viva/engage/engage-report-deviceusageuserdetail.mdx +6 -0
- package/docs/docs/cmd/viva/engage/engage-report-groupsactivitycounts.mdx +8 -0
- package/docs/docs/cmd/viva/engage/engage-report-groupsactivitydetail.mdx +6 -0
- package/docs/docs/cmd/viva/engage/engage-report-groupsactivitygroupcounts.mdx +8 -0
- package/package.json +1 -1
|
@@ -8,6 +8,9 @@ import request from '../../request.js';
|
|
|
8
8
|
import { formatting } from '../../utils/formatting.js';
|
|
9
9
|
import GraphCommand from "./GraphCommand.js";
|
|
10
10
|
class PeriodBasedReport extends GraphCommand {
|
|
11
|
+
get allowedOutputs() {
|
|
12
|
+
return ['json', 'csv'];
|
|
13
|
+
}
|
|
11
14
|
constructor() {
|
|
12
15
|
super();
|
|
13
16
|
_PeriodBasedReport_instances.add(this);
|
|
@@ -33,6 +33,9 @@ class SpfxProjectGithubWorkflowAddCommand extends BaseProjectCommand {
|
|
|
33
33
|
if (this.projectRootPath === null) {
|
|
34
34
|
throw new CommandError(`Couldn't find project root folder`, _a.ERROR_NO_PROJECT_ROOT_FOLDER);
|
|
35
35
|
}
|
|
36
|
+
if (!args.options.overwrite) {
|
|
37
|
+
await this.warn(logger, `We recommend always using the --overwrite option and it will become the default behavior in next major release. Overwriting your sppkg file on every deployment is required to make continuous delivery of the latest version of your app which is the aim of the continuous delivery pipeline.`);
|
|
38
|
+
}
|
|
36
39
|
const solutionPackageJsonFile = path.join(this.projectRootPath, 'package.json');
|
|
37
40
|
const packageJson = fs.readFileSync(solutionPackageJsonFile, 'utf-8');
|
|
38
41
|
const solutionName = JSON.parse(packageJson).name;
|
|
@@ -10,6 +10,9 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
12
|
class TeamsReportDirectroutingcallsCommand extends GraphCommand {
|
|
13
|
+
get allowedOutputs() {
|
|
14
|
+
return ['json', 'csv'];
|
|
15
|
+
}
|
|
13
16
|
get name() {
|
|
14
17
|
return commands.REPORT_DIRECTROUTINGCALLS;
|
|
15
18
|
}
|
|
@@ -10,6 +10,9 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
12
|
class TeamsReportPstncallsCommand extends GraphCommand {
|
|
13
|
+
get allowedOutputs() {
|
|
14
|
+
return ['json', 'csv'];
|
|
15
|
+
}
|
|
13
16
|
get name() {
|
|
14
17
|
return commands.REPORT_PSTNCALLS;
|
|
15
18
|
}
|
|
@@ -3,12 +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 _TeamsTeamAddCommand_instances, _TeamsTeamAddCommand_initTelemetry, _TeamsTeamAddCommand_initOptions, _TeamsTeamAddCommand_initOptionSets;
|
|
6
|
+
var _TeamsTeamAddCommand_instances, _TeamsTeamAddCommand_initTelemetry, _TeamsTeamAddCommand_initOptions, _TeamsTeamAddCommand_initValidators, _TeamsTeamAddCommand_initOptionSets;
|
|
7
7
|
import { setTimeout } from 'timers/promises';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { validation } from '../../../../utils/validation.js';
|
|
13
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
14
|
+
import auth from '../../../../Auth.js';
|
|
15
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
16
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
17
|
class TeamsTeamAddCommand extends GraphCommand {
|
|
13
18
|
get name() {
|
|
14
19
|
return commands.TEAM_ADD;
|
|
@@ -22,9 +27,14 @@ class TeamsTeamAddCommand extends GraphCommand {
|
|
|
22
27
|
this.pollingInterval = 30000;
|
|
23
28
|
__classPrivateFieldGet(this, _TeamsTeamAddCommand_instances, "m", _TeamsTeamAddCommand_initTelemetry).call(this);
|
|
24
29
|
__classPrivateFieldGet(this, _TeamsTeamAddCommand_instances, "m", _TeamsTeamAddCommand_initOptions).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _TeamsTeamAddCommand_instances, "m", _TeamsTeamAddCommand_initValidators).call(this);
|
|
25
31
|
__classPrivateFieldGet(this, _TeamsTeamAddCommand_instances, "m", _TeamsTeamAddCommand_initOptionSets).call(this);
|
|
26
32
|
}
|
|
27
33
|
async commandAction(logger, args) {
|
|
34
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[this.resource].accessToken);
|
|
35
|
+
if (isAppOnlyAccessToken && !args.options.ownerUserNames && !args.options.ownerIds && !args.options.ownerEmails) {
|
|
36
|
+
this.handleError(`Specify at least 'ownerUserNames', 'ownerIds' or 'ownerEmails' when using application permissions.`);
|
|
37
|
+
}
|
|
28
38
|
let requestBody;
|
|
29
39
|
if (args.options.template) {
|
|
30
40
|
if (this.verbose) {
|
|
@@ -54,6 +64,19 @@ class TeamsTeamAddCommand extends GraphCommand {
|
|
|
54
64
|
description: args.options.description
|
|
55
65
|
};
|
|
56
66
|
}
|
|
67
|
+
let members = [];
|
|
68
|
+
if (args.options.ownerEmails || args.options.ownerIds || args.options.ownerUserNames) {
|
|
69
|
+
await this.retrieveMembersToAdd(members, 'owner', args.options.ownerEmails, args.options.ownerIds, args.options.ownerUserNames);
|
|
70
|
+
}
|
|
71
|
+
if (args.options.memberEmails || args.options.memberIds || args.options.memberUserNames) {
|
|
72
|
+
await this.retrieveMembersToAdd(members, 'member', args.options.memberEmails, args.options.memberIds, args.options.memberUserNames);
|
|
73
|
+
}
|
|
74
|
+
// We filter out the first owner here and add it to the request body when we are using application only permissions. This is required or the Graph API will throw an error.
|
|
75
|
+
if (members.length > 0 && members.filter(y => y.roles.includes('owner')).length > 0 && isAppOnlyAccessToken) {
|
|
76
|
+
const groupOwner = members.filter(y => y.roles.includes('owner')).slice(0, 1);
|
|
77
|
+
members = members.filter(y => y !== groupOwner[0]);
|
|
78
|
+
requestBody.members = groupOwner;
|
|
79
|
+
}
|
|
57
80
|
const requestOptionsPost = {
|
|
58
81
|
url: `${this.resource}/v1.0/teams`,
|
|
59
82
|
headers: {
|
|
@@ -72,12 +95,18 @@ class TeamsTeamAddCommand extends GraphCommand {
|
|
|
72
95
|
responseType: 'json'
|
|
73
96
|
};
|
|
74
97
|
const teamsAsyncOperation = await request.get(requestOptions);
|
|
75
|
-
if (!args.options.wait) {
|
|
98
|
+
if (!args.options.wait && members.length === 0) {
|
|
76
99
|
await logger.log(teamsAsyncOperation);
|
|
77
100
|
}
|
|
78
101
|
else {
|
|
79
102
|
await this.waitUntilTeamFinishedProvisioning(teamsAsyncOperation, requestOptions, logger);
|
|
80
103
|
const entraGroup = await this.getEntraGroup(teamsAsyncOperation.targetResourceId, logger);
|
|
104
|
+
if (members.length > 0) {
|
|
105
|
+
if (this.verbose) {
|
|
106
|
+
await logger.logToStderr('Adding members to the team...');
|
|
107
|
+
}
|
|
108
|
+
await this.addMembers(members, entraGroup.id);
|
|
109
|
+
}
|
|
81
110
|
await logger.log(entraGroup);
|
|
82
111
|
}
|
|
83
112
|
}
|
|
@@ -85,6 +114,19 @@ class TeamsTeamAddCommand extends GraphCommand {
|
|
|
85
114
|
this.handleRejectedODataJsonPromise(err);
|
|
86
115
|
}
|
|
87
116
|
}
|
|
117
|
+
async addMembers(members, groupId) {
|
|
118
|
+
for (const member of members) {
|
|
119
|
+
const requestOptions = {
|
|
120
|
+
url: `${this.resource}/v1.0/teams/${groupId}/members`,
|
|
121
|
+
headers: {
|
|
122
|
+
'content-type': 'application/json;odata.metadata=none'
|
|
123
|
+
},
|
|
124
|
+
responseType: 'json',
|
|
125
|
+
data: member
|
|
126
|
+
};
|
|
127
|
+
await request.post(requestOptions);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
88
130
|
async waitUntilTeamFinishedProvisioning(teamsAsyncOperation, requestOptions, logger) {
|
|
89
131
|
if (teamsAsyncOperation.status === 'succeeded') {
|
|
90
132
|
if (this.verbose) {
|
|
@@ -118,6 +160,31 @@ class TeamsTeamAddCommand extends GraphCommand {
|
|
|
118
160
|
}
|
|
119
161
|
return group;
|
|
120
162
|
}
|
|
163
|
+
async retrieveMembersToAdd(members, role, emails, ids, userNames) {
|
|
164
|
+
let itemsToProcess = [];
|
|
165
|
+
if (emails) {
|
|
166
|
+
itemsToProcess = await entraUser.getUserIdsByEmails(formatting.splitAndTrim(emails));
|
|
167
|
+
}
|
|
168
|
+
else if (ids) {
|
|
169
|
+
itemsToProcess = formatting.splitAndTrim(ids);
|
|
170
|
+
}
|
|
171
|
+
else if (userNames) {
|
|
172
|
+
itemsToProcess = await entraUser.getUserIdsByUpns(formatting.splitAndTrim(userNames));
|
|
173
|
+
}
|
|
174
|
+
itemsToProcess.map((item) => {
|
|
175
|
+
const member = members.find((y) => y['user@odata.bind'] === `https://graph.microsoft.com/v1.0/users('${item}')`);
|
|
176
|
+
if (!member) {
|
|
177
|
+
members.push({
|
|
178
|
+
'@odata.type': '#microsoft.graph.aadUserConversationMember',
|
|
179
|
+
'user@odata.bind': `https://graph.microsoft.com/v1.0/users('${item}')`,
|
|
180
|
+
roles: [role]
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
member.roles.push(role);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
121
188
|
}
|
|
122
189
|
_TeamsTeamAddCommand_instances = new WeakSet(), _TeamsTeamAddCommand_initTelemetry = function _TeamsTeamAddCommand_initTelemetry() {
|
|
123
190
|
this.telemetry.push((args) => {
|
|
@@ -125,7 +192,13 @@ _TeamsTeamAddCommand_instances = new WeakSet(), _TeamsTeamAddCommand_initTelemet
|
|
|
125
192
|
name: typeof args.options.name !== 'undefined',
|
|
126
193
|
description: typeof args.options.description !== 'undefined',
|
|
127
194
|
template: typeof args.options.template !== 'undefined',
|
|
128
|
-
wait: !!args.options.wait
|
|
195
|
+
wait: !!args.options.wait,
|
|
196
|
+
ownerUserNames: typeof args.options.ownerUserNames !== 'undefined',
|
|
197
|
+
ownerIds: typeof args.options.ownerIds !== 'undefined',
|
|
198
|
+
ownerEmails: typeof args.options.ownerEmails !== 'undefined',
|
|
199
|
+
memberUserNames: typeof args.options.memberUserNames !== 'undefined',
|
|
200
|
+
memberIds: typeof args.options.memberIds !== 'undefined',
|
|
201
|
+
memberEmails: typeof args.options.memberEmails !== 'undefined'
|
|
129
202
|
});
|
|
130
203
|
});
|
|
131
204
|
}, _TeamsTeamAddCommand_initOptions = function _TeamsTeamAddCommand_initOptions() {
|
|
@@ -137,6 +210,52 @@ _TeamsTeamAddCommand_instances = new WeakSet(), _TeamsTeamAddCommand_initTelemet
|
|
|
137
210
|
option: '--template [template]'
|
|
138
211
|
}, {
|
|
139
212
|
option: '--wait'
|
|
213
|
+
}, {
|
|
214
|
+
option: '--ownerUserNames [ownerUserNames]'
|
|
215
|
+
}, {
|
|
216
|
+
option: '--ownerIds [ownerIds]'
|
|
217
|
+
}, {
|
|
218
|
+
option: '--ownerEmails [ownerEmails]'
|
|
219
|
+
}, {
|
|
220
|
+
option: '--memberUserNames [memberUserNames]'
|
|
221
|
+
}, {
|
|
222
|
+
option: '--memberIds [memberIds]'
|
|
223
|
+
}, {
|
|
224
|
+
option: '--memberEmails [memberEmails]'
|
|
225
|
+
});
|
|
226
|
+
}, _TeamsTeamAddCommand_initValidators = function _TeamsTeamAddCommand_initValidators() {
|
|
227
|
+
this.validators.push(async (args) => {
|
|
228
|
+
if (args.options.ownerUserNames) {
|
|
229
|
+
const isValidUserPrincipalNameArray = validation.isValidUserPrincipalNameArray(formatting.splitAndTrim(args.options.ownerUserNames));
|
|
230
|
+
if (isValidUserPrincipalNameArray !== true) {
|
|
231
|
+
return `Owner username '${isValidUserPrincipalNameArray}' is invalid for option 'ownerUserNames'.`;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
if (args.options.ownerEmails) {
|
|
235
|
+
const isValidUserPrincipalNameArray = validation.isValidUserPrincipalNameArray(formatting.splitAndTrim(args.options.ownerEmails));
|
|
236
|
+
if (isValidUserPrincipalNameArray !== true) {
|
|
237
|
+
return `Owner email '${isValidUserPrincipalNameArray}' is invalid for option 'ownerEmails'.`;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (args.options.ownerIds && !validation.isValidGuidArray(formatting.splitAndTrim(args.options.ownerIds))) {
|
|
241
|
+
return `The option 'ownerIds' contains one or more invalid GUIDs.`;
|
|
242
|
+
}
|
|
243
|
+
if (args.options.memberUserNames) {
|
|
244
|
+
const isValidUserPrincipalNameArray = validation.isValidUserPrincipalNameArray(formatting.splitAndTrim(args.options.memberUserNames));
|
|
245
|
+
if (isValidUserPrincipalNameArray !== true) {
|
|
246
|
+
return `Member username '${isValidUserPrincipalNameArray}' is invalid for option 'memberUserNames'.`;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (args.options.memberEmails) {
|
|
250
|
+
const isValidUserPrincipalNameArray = validation.isValidUserPrincipalNameArray(formatting.splitAndTrim(args.options.memberEmails));
|
|
251
|
+
if (isValidUserPrincipalNameArray !== true) {
|
|
252
|
+
return `Member email '${isValidUserPrincipalNameArray}' is invalid for option 'memberEmails'.`;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if (args.options.memberIds && !validation.isValidGuidArray(formatting.splitAndTrim(args.options.memberIds))) {
|
|
256
|
+
return `The option 'memberIds' contains one or more invalid GUIDs`;
|
|
257
|
+
}
|
|
258
|
+
return true;
|
|
140
259
|
});
|
|
141
260
|
}, _TeamsTeamAddCommand_initOptionSets = function _TeamsTeamAddCommand_initOptionSets() {
|
|
142
261
|
this.optionSets.push({
|
|
@@ -149,6 +268,16 @@ _TeamsTeamAddCommand_instances = new WeakSet(), _TeamsTeamAddCommand_initTelemet
|
|
|
149
268
|
runsWhen: (args) => {
|
|
150
269
|
return !args.options.template;
|
|
151
270
|
}
|
|
271
|
+
}, {
|
|
272
|
+
options: ['ownerUserNames', 'ownerIds', 'ownerEmails'],
|
|
273
|
+
runsWhen: (args) => {
|
|
274
|
+
return args.options.ownerUserNames || args.options.ownerIds || args.options.ownerEmails;
|
|
275
|
+
}
|
|
276
|
+
}, {
|
|
277
|
+
options: ['memberUserNames', 'memberIds', 'memberEmails'],
|
|
278
|
+
runsWhen: (args) => {
|
|
279
|
+
return args.options.memberUserNames || args.options.memberIds || args.options.memberEmails;
|
|
280
|
+
}
|
|
152
281
|
});
|
|
153
282
|
};
|
|
154
283
|
export default new TeamsTeamAddCommand();
|
|
@@ -3,6 +3,9 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
3
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
5
|
class TenantReportOffice365ActivationCountsCommand extends GraphCommand {
|
|
6
|
+
get allowedOutputs() {
|
|
7
|
+
return ['json', 'csv'];
|
|
8
|
+
}
|
|
6
9
|
get name() {
|
|
7
10
|
return commands.REPORT_OFFICE365ACTIVATIONCOUNTS;
|
|
8
11
|
}
|
|
@@ -3,6 +3,9 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
3
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
5
|
class TenantReportOffice365ActivationsUserCountsCommand extends GraphCommand {
|
|
6
|
+
get allowedOutputs() {
|
|
7
|
+
return ['json', 'csv'];
|
|
8
|
+
}
|
|
6
9
|
get name() {
|
|
7
10
|
return commands.REPORT_OFFICE365ACTIVATIONSUSERCOUNTS;
|
|
8
11
|
}
|
|
@@ -3,6 +3,9 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
3
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
4
4
|
import commands from '../../commands.js';
|
|
5
5
|
class TenantReportOffice365ActivationsUserDetailCommand extends GraphCommand {
|
|
6
|
+
get allowedOutputs() {
|
|
7
|
+
return ['json', 'csv'];
|
|
8
|
+
}
|
|
6
9
|
get name() {
|
|
7
10
|
return commands.REPORT_OFFICE365ACTIVATIONSUSERDETAIL;
|
|
8
11
|
}
|
package/dist/utils/entraUser.js
CHANGED
|
@@ -74,6 +74,42 @@ export const entraUser = {
|
|
|
74
74
|
}
|
|
75
75
|
return res.value[0].id;
|
|
76
76
|
},
|
|
77
|
+
/**
|
|
78
|
+
* Retrieve the IDs of users by their mail. There is no guarantee that the order of the returned IDs will match the order of the specified mails.
|
|
79
|
+
* @param emails Array of user mails.
|
|
80
|
+
* @returns Array of user IDs.
|
|
81
|
+
*/
|
|
82
|
+
async getUserIdsByEmails(emails) {
|
|
83
|
+
const userIds = [];
|
|
84
|
+
for (let i = 0; i < emails.length; i += 20) {
|
|
85
|
+
const emailsChunk = emails.slice(i, i + 20);
|
|
86
|
+
const requestOptions = {
|
|
87
|
+
url: `${graphResource}/v1.0/$batch`,
|
|
88
|
+
headers: {
|
|
89
|
+
accept: 'application/json;odata.metadata=none'
|
|
90
|
+
},
|
|
91
|
+
responseType: 'json',
|
|
92
|
+
data: {
|
|
93
|
+
requests: emailsChunk.map((email, index) => ({
|
|
94
|
+
id: index + 1,
|
|
95
|
+
method: 'GET',
|
|
96
|
+
url: `/users?$filter=mail eq '${formatting.encodeQueryParameter(email)}'&$select=id`,
|
|
97
|
+
headers: {
|
|
98
|
+
accept: 'application/json;odata.metadata=none'
|
|
99
|
+
}
|
|
100
|
+
}))
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
const res = await request.post(requestOptions);
|
|
104
|
+
for (const response of res.responses) {
|
|
105
|
+
if (response.status !== 200) {
|
|
106
|
+
throw Error(`The specified user with mail '${emailsChunk[response.id - 1]}' does not exist.`);
|
|
107
|
+
}
|
|
108
|
+
userIds.push(response.body.id);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return userIds;
|
|
112
|
+
},
|
|
77
113
|
/**
|
|
78
114
|
* Retrieve the UPN of a user by its ID.
|
|
79
115
|
* @param id User ID.
|
|
@@ -30,6 +30,14 @@ m365 aad m365group report activitycounts [options]
|
|
|
30
30
|
|
|
31
31
|
<Global />
|
|
32
32
|
|
|
33
|
+
## Remarks
|
|
34
|
+
|
|
35
|
+
:::info
|
|
36
|
+
|
|
37
|
+
This command supports only csv and json output.
|
|
38
|
+
|
|
39
|
+
:::
|
|
40
|
+
|
|
33
41
|
## Examples
|
|
34
42
|
|
|
35
43
|
Get the number of group activities across group workloads for the last week
|
|
@@ -33,6 +33,14 @@ m365 aad m365group report activitydetail [options]
|
|
|
33
33
|
|
|
34
34
|
<Global />
|
|
35
35
|
|
|
36
|
+
## Remarks
|
|
37
|
+
|
|
38
|
+
:::info
|
|
39
|
+
|
|
40
|
+
This command supports only csv and json output.
|
|
41
|
+
|
|
42
|
+
:::
|
|
43
|
+
|
|
36
44
|
## Examples
|
|
37
45
|
|
|
38
46
|
Get details about Microsoft 365 Groups activity by group for the last week
|
|
@@ -30,6 +30,14 @@ m365 aad m365group report activityfilecounts [options]
|
|
|
30
30
|
|
|
31
31
|
<Global />
|
|
32
32
|
|
|
33
|
+
## Remarks
|
|
34
|
+
|
|
35
|
+
:::info
|
|
36
|
+
|
|
37
|
+
This command supports only csv and json output.
|
|
38
|
+
|
|
39
|
+
:::
|
|
40
|
+
|
|
33
41
|
## Examples
|
|
34
42
|
|
|
35
43
|
Get the total number of files and how many of them were active across all group sites associated with an Microsoft 365 Group for the last week
|
|
@@ -30,6 +30,14 @@ m365 aad m365group report activitygroupcounts [options]
|
|
|
30
30
|
|
|
31
31
|
<Global />
|
|
32
32
|
|
|
33
|
+
## Remarks
|
|
34
|
+
|
|
35
|
+
:::info
|
|
36
|
+
|
|
37
|
+
This command supports only csv and json output.
|
|
38
|
+
|
|
39
|
+
:::
|
|
40
|
+
|
|
33
41
|
## Examples
|
|
34
42
|
|
|
35
43
|
Get the daily total number of groups and how many of them were active based on activities for the last week
|
|
@@ -30,6 +30,14 @@ m365 aad m365group report activitystorage [options]
|
|
|
30
30
|
|
|
31
31
|
<Global />
|
|
32
32
|
|
|
33
|
+
## Remarks
|
|
34
|
+
|
|
35
|
+
:::info
|
|
36
|
+
|
|
37
|
+
This command supports only csv and json output.
|
|
38
|
+
|
|
39
|
+
:::
|
|
40
|
+
|
|
33
41
|
## Examples
|
|
34
42
|
|
|
35
43
|
Get the total storage used across all group mailboxes and group sites for the last week
|
|
@@ -21,6 +21,14 @@ m365 onedrive report activityfilecounts [options]
|
|
|
21
21
|
|
|
22
22
|
<Global />
|
|
23
23
|
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
:::info
|
|
27
|
+
|
|
28
|
+
This command supports only csv and json output.
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
24
32
|
## Examples
|
|
25
33
|
|
|
26
34
|
Gets the number of unique, licensed users that performed file interactions against any OneDrive account for the last week
|
|
@@ -21,6 +21,14 @@ m365 onedrive report activityusercounts [options]
|
|
|
21
21
|
|
|
22
22
|
<Global />
|
|
23
23
|
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
:::info
|
|
27
|
+
|
|
28
|
+
This command supports only csv and json output.
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
24
32
|
## Examples
|
|
25
33
|
|
|
26
34
|
Gets the trend in the number of active OneDrive users for the last week
|
|
@@ -24,6 +24,14 @@ m365 onedrive report activityuserdetail [options]
|
|
|
24
24
|
|
|
25
25
|
<Global />
|
|
26
26
|
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
:::info
|
|
30
|
+
|
|
31
|
+
This command supports only csv and json output.
|
|
32
|
+
|
|
33
|
+
:::
|
|
34
|
+
|
|
27
35
|
## Examples
|
|
28
36
|
|
|
29
37
|
Gets details about OneDrive activity by user for the last week
|
|
@@ -23,6 +23,14 @@ m365 onedrive report usageaccountcounts [options]
|
|
|
23
23
|
|
|
24
24
|
## Remarks
|
|
25
25
|
|
|
26
|
+
:::info
|
|
27
|
+
|
|
28
|
+
This command supports only csv and json output.
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
32
|
+
## Remarks
|
|
33
|
+
|
|
26
34
|
Any site on which users viewed, modified, uploaded, downloaded, shared, or synced files is considered an active site
|
|
27
35
|
|
|
28
36
|
## Examples
|
|
@@ -24,6 +24,14 @@ m365 onedrive report usageaccountdetail [options]
|
|
|
24
24
|
|
|
25
25
|
<Global />
|
|
26
26
|
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
:::info
|
|
30
|
+
|
|
31
|
+
This command supports only csv and json output.
|
|
32
|
+
|
|
33
|
+
:::
|
|
34
|
+
|
|
27
35
|
## Examples
|
|
28
36
|
|
|
29
37
|
Gets details about OneDrive usage by account for the last week
|
|
@@ -25,6 +25,12 @@ m365 onedrive report usagefilecounts [options]
|
|
|
25
25
|
|
|
26
26
|
A file is considered active if it has been saved, synced, modified, or shared within the specified time period.
|
|
27
27
|
|
|
28
|
+
:::info
|
|
29
|
+
|
|
30
|
+
This command supports only csv and json output.
|
|
31
|
+
|
|
32
|
+
:::
|
|
33
|
+
|
|
28
34
|
## Examples
|
|
29
35
|
|
|
30
36
|
Gets the total number of files across all sites and how many are active files for the last week
|
|
@@ -21,6 +21,14 @@ m365 onedrive report usagestorage [options]
|
|
|
21
21
|
|
|
22
22
|
<Global />
|
|
23
23
|
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
:::info
|
|
27
|
+
|
|
28
|
+
This command supports only csv and json output.
|
|
29
|
+
|
|
30
|
+
:::
|
|
31
|
+
|
|
24
32
|
## Examples
|
|
25
33
|
|
|
26
34
|
Gets the trend on the amount of storage you are using in OneDrive for Business for the last week
|
|
@@ -12,6 +12,14 @@ Enables you to understand the trends of email activity (like how many were sent,
|
|
|
12
12
|
m365 outlook report mailactivitycounts [options]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
:::info
|
|
18
|
+
|
|
19
|
+
This command supports only csv and json output.
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
15
23
|
## Options
|
|
16
24
|
|
|
17
25
|
```md definition-list
|
|
@@ -12,6 +12,14 @@ Enables you to understand trends on the number of unique users who are performin
|
|
|
12
12
|
m365 outlook report mailactivityusercounts [options]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
:::info
|
|
18
|
+
|
|
19
|
+
This command supports only csv and json output.
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
15
23
|
## Options
|
|
16
24
|
|
|
17
25
|
```md definition-list
|
|
@@ -12,6 +12,14 @@ Gets details about email activity users have performed
|
|
|
12
12
|
m365 outlook report mailactivityuserdetail [options]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
:::info
|
|
18
|
+
|
|
19
|
+
This command supports only csv and json output.
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
15
23
|
## Options
|
|
16
24
|
|
|
17
25
|
```md definition-list
|
|
@@ -12,6 +12,14 @@ Gets the count of unique users that connected to Exchange Online using any email
|
|
|
12
12
|
m365 outlook report mailappusageusercounts [options]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
:::info
|
|
18
|
+
|
|
19
|
+
This command supports only csv and json output.
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
15
23
|
## Options
|
|
16
24
|
|
|
17
25
|
```md definition-list
|
|
@@ -12,6 +12,14 @@ Gets details about which activities users performed on the various email apps
|
|
|
12
12
|
m365 outlook report mailappusageuserdetail [options]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
:::info
|
|
18
|
+
|
|
19
|
+
This command supports only csv and json output.
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
15
23
|
## Options
|
|
16
24
|
|
|
17
25
|
```md definition-list
|
|
@@ -12,6 +12,14 @@ Gets the count of unique users by Outlook desktop version.
|
|
|
12
12
|
m365 outlook report mailappusageversionsusercounts [options]
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
:::info
|
|
18
|
+
|
|
19
|
+
This command supports only csv and json output.
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
15
23
|
## Options
|
|
16
24
|
|
|
17
25
|
```md definition-list
|
|
@@ -25,6 +25,12 @@ m365 outlook report mailboxusagemailboxcount [options]
|
|
|
25
25
|
|
|
26
26
|
A mailbox is considered active if the user sent or read any email.
|
|
27
27
|
|
|
28
|
+
:::info
|
|
29
|
+
|
|
30
|
+
This command supports only csv and json output.
|
|
31
|
+
|
|
32
|
+
:::
|
|
33
|
+
|
|
28
34
|
## Examples
|
|
29
35
|
|
|
30
36
|
Gets the total number of user mailboxes in your organization and how many are active each day for the last week.
|