@pnp/cli-microsoft365 6.3.0-beta.fee5cdb → 6.4.0-beta.b1f742c
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/dist/appInsights.js +2 -1
- package/dist/cli/Cli.js +70 -2
- package/dist/m365/aad/commands/license/license-list.js +41 -0
- package/dist/m365/aad/commands/user/user-add.js +223 -0
- package/dist/m365/aad/commands/user/user-license-add.js +88 -0
- package/dist/m365/aad/commands/user/user-license-list.js +99 -0
- package/dist/m365/aad/commands/user/user-license-remove.js +114 -0
- package/dist/m365/aad/commands/user/user-recyclebinitem-clear.js +1 -1
- package/dist/m365/aad/commands/user/user-recyclebinitem-list.js +41 -0
- package/dist/m365/aad/commands/user/user-recyclebinitem-remove.js +92 -0
- package/dist/m365/aad/commands/user/user-recyclebinitem-restore.js +77 -0
- package/dist/m365/aad/commands/user/user-remove.js +107 -0
- package/dist/m365/aad/commands.js +9 -0
- package/dist/m365/flow/commands/environment/FlowEnvironmentDetails.js +3 -0
- package/dist/m365/flow/commands/environment/environment-get.js +26 -11
- package/dist/m365/pp/commands/environment/environment-get.js +18 -9
- package/dist/m365/spo/commands/file/file-move.js +0 -2
- package/dist/m365/spo/commands/folder/folder-copy.js +0 -2
- package/dist/m365/spo/commands/folder/folder-move.js +0 -2
- package/dist/m365/spo/commands/site/site-add.js +0 -3
- package/dist/m365/spo/commands/site/site-remove.js +0 -3
- package/dist/m365/spo/commands/site/site-set.js +0 -2
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +0 -1
- package/dist/m365/teams/commands/team/team-add.js +3 -8
- package/dist/utils/session.js +18 -0
- package/dist/utils/spo.js +3 -12
- package/docs/docs/cmd/aad/license/license-list.md +87 -0
- package/docs/docs/cmd/aad/user/user-add.md +168 -0
- package/docs/docs/cmd/aad/user/user-license-add.md +108 -0
- package/docs/docs/cmd/aad/user/user-license-list.md +98 -0
- package/docs/docs/cmd/aad/user/user-license-remove.md +43 -0
- package/docs/docs/cmd/aad/user/user-recyclebinitem-clear.md +1 -1
- package/docs/docs/cmd/aad/user/user-recyclebinitem-list.md +82 -0
- package/docs/docs/cmd/aad/user/user-recyclebinitem-remove.md +45 -0
- package/docs/docs/cmd/aad/user/user-recyclebinitem-restore.md +99 -0
- package/docs/docs/cmd/aad/user/user-remove.md +51 -0
- package/docs/docs/cmd/aad/user/user-set.md +1 -1
- package/docs/docs/cmd/flow/environment/environment-get.md +31 -3
- package/docs/docs/cmd/spo/homesite/homesite-get.md +20 -1
- package/docs/docs/cmd/spo/homesite/homesite-remove.md +8 -2
- package/docs/docs/cmd/spo/homesite/homesite-set.md +8 -2
- package/docs/docs/cmd/spo/hubsite/hubsite-connect.md +9 -9
- package/docs/docs/cmd/spo/hubsite/hubsite-data-get.md +34 -5
- package/docs/docs/cmd/spo/hubsite/hubsite-disconnect.md +6 -6
- package/docs/docs/cmd/spo/hubsite/hubsite-get.md +36 -19
- package/docs/docs/cmd/spo/hubsite/hubsite-list.md +59 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-register.md +30 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-grant.md +6 -6
- package/docs/docs/cmd/spo/hubsite/hubsite-rights-revoke.md +4 -4
- package/docs/docs/cmd/spo/hubsite/hubsite-set.md +40 -15
- package/docs/docs/cmd/spo/hubsite/hubsite-unregister.md +4 -4
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +7 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +9 -3
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +8 -2
- package/docs/docs/cmd/spo/list/list-add.md +123 -57
- package/docs/docs/cmd/spo/list/list-contenttype-add.md +50 -5
- package/docs/docs/cmd/spo/list/list-contenttype-default-set.md +4 -4
- package/docs/docs/cmd/spo/list/list-contenttype-list.md +49 -4
- package/docs/docs/cmd/spo/list/list-contenttype-remove.md +6 -6
- package/docs/docs/cmd/spo/list/list-get.md +70 -4
- package/docs/docs/cmd/spo/list/list-list.md +70 -2
- package/docs/docs/cmd/spo/list/list-remove.md +6 -6
- package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.md +2 -2
- package/docs/docs/cmd/spo/list/list-retentionlabel-get.md +36 -3
- package/docs/docs/cmd/spo/list/list-retentionlabel-remove.md +3 -3
- package/docs/docs/cmd/spo/list/list-roleassignment-add.md +6 -6
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +3 -3
- package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -9
- package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +7 -7
- package/docs/docs/cmd/spo/list/list-set.md +61 -61
- package/docs/docs/cmd/spo/list/list-sitescript-get.md +35 -3
- package/docs/docs/cmd/spo/list/list-view-add.md +66 -5
- package/docs/docs/cmd/spo/list/list-view-field-add.md +10 -10
- package/docs/docs/cmd/spo/list/list-view-get.md +61 -0
- package/docs/docs/cmd/spo/list/list-view-list.md +61 -0
- package/docs/docs/cmd/spo/list/list-view-set.md +1 -1
- package/docs/docs/cmd/spo/list/list-webhook-add.md +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-get.md +19 -0
- package/docs/docs/cmd/spo/list/list-webhook-list.md +19 -0
- package/docs/docs/cmd/spo/listitem/listitem-add.md +29 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +17 -2
- package/docs/docs/cmd/spo/listitem/listitem-get.md +57 -0
- package/docs/docs/cmd/spo/listitem/listitem-isrecord.md +6 -0
- package/docs/docs/cmd/spo/listitem/listitem-list.md +28 -0
- package/docs/docs/cmd/spo/listitem/listitem-record-declare.md +15 -0
- package/docs/docs/cmd/spo/listitem/listitem-set.md +30 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +22 -0
- package/npm-shrinkwrap.json +3 -2
- package/package.json +2 -1
|
@@ -166,7 +166,6 @@ class SpoSiteAddCommand extends SpoCommand_1.default {
|
|
|
166
166
|
}
|
|
167
167
|
createClassicSite(logger, args) {
|
|
168
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
-
this.dots = '';
|
|
170
169
|
try {
|
|
171
170
|
this.spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
172
171
|
this.context = yield spo_1.spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
@@ -228,7 +227,6 @@ class SpoSiteAddCommand extends SpoCommand_1.default {
|
|
|
228
227
|
reject,
|
|
229
228
|
logger,
|
|
230
229
|
currentContext: this.context,
|
|
231
|
-
dots: this.dots,
|
|
232
230
|
verbose: this.verbose,
|
|
233
231
|
debug: this.debug
|
|
234
232
|
});
|
|
@@ -362,7 +360,6 @@ class SpoSiteAddCommand extends SpoCommand_1.default {
|
|
|
362
360
|
reject,
|
|
363
361
|
logger,
|
|
364
362
|
currentContext: this.context,
|
|
365
|
-
dots: this.dots,
|
|
366
363
|
verbose: this.verbose,
|
|
367
364
|
debug: this.debug
|
|
368
365
|
});
|
|
@@ -43,7 +43,6 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
const removeSite = () => __awaiter(this, void 0, void 0, function* () {
|
|
45
45
|
try {
|
|
46
|
-
this.dots = '';
|
|
47
46
|
if (args.options.fromRecycleBin) {
|
|
48
47
|
yield this.deleteSiteWithoutGroup(logger, args);
|
|
49
48
|
}
|
|
@@ -203,7 +202,6 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
203
202
|
reject,
|
|
204
203
|
logger,
|
|
205
204
|
currentContext: this.context,
|
|
206
|
-
dots: this.dots,
|
|
207
205
|
debug: this.debug,
|
|
208
206
|
verbose: this.verbose
|
|
209
207
|
});
|
|
@@ -248,7 +246,6 @@ class SpoSiteRemoveCommand extends SpoCommand_1.default {
|
|
|
248
246
|
reject,
|
|
249
247
|
logger,
|
|
250
248
|
currentContext: this.context,
|
|
251
|
-
dots: this.dots,
|
|
252
249
|
debug: this.debug,
|
|
253
250
|
verbose: this.verbose
|
|
254
251
|
});
|
|
@@ -46,7 +46,6 @@ class SpoSiteSetCommand extends SpoCommand_1.default {
|
|
|
46
46
|
commandAction(logger, args) {
|
|
47
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
48
|
try {
|
|
49
|
-
this.dots = '';
|
|
50
49
|
this.tenantId = yield spo_1.spo.getTenantId(logger, this.debug);
|
|
51
50
|
this.spoAdminUrl = yield spo_1.spo.getSpoAdminUrl(logger, this.debug);
|
|
52
51
|
this.context = yield spo_1.spo.ensureFormDigest(this.spoAdminUrl, logger, this.context, this.debug);
|
|
@@ -128,7 +127,6 @@ class SpoSiteSetCommand extends SpoCommand_1.default {
|
|
|
128
127
|
reject,
|
|
129
128
|
logger,
|
|
130
129
|
currentContext: this.context,
|
|
131
|
-
dots: this.dots,
|
|
132
130
|
debug: this.debug,
|
|
133
131
|
verbose: this.verbose
|
|
134
132
|
});
|
|
@@ -44,7 +44,6 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
44
44
|
}
|
|
45
45
|
commandAction(logger, args) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
this.dots = '';
|
|
48
47
|
let requestBody;
|
|
49
48
|
if (args.options.template) {
|
|
50
49
|
if (this.verbose) {
|
|
@@ -95,7 +94,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
95
94
|
}
|
|
96
95
|
else {
|
|
97
96
|
setTimeout(() => {
|
|
98
|
-
this.waitUntilFinished(requestOptions, resolve, reject, logger
|
|
97
|
+
this.waitUntilFinished(requestOptions, resolve, reject, logger);
|
|
99
98
|
}, this.pollingInterval);
|
|
100
99
|
}
|
|
101
100
|
}));
|
|
@@ -113,11 +112,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
113
112
|
}
|
|
114
113
|
});
|
|
115
114
|
}
|
|
116
|
-
waitUntilFinished(requestOptions, resolve, reject, logger
|
|
117
|
-
if (!this.debug && this.verbose) {
|
|
118
|
-
dots += '.';
|
|
119
|
-
process.stdout.write(`\r${dots}`);
|
|
120
|
-
}
|
|
115
|
+
waitUntilFinished(requestOptions, resolve, reject, logger) {
|
|
121
116
|
request_1.default
|
|
122
117
|
.get(requestOptions)
|
|
123
118
|
.then((teamsAsyncOperation) => {
|
|
@@ -133,7 +128,7 @@ class TeamsTeamAddCommand extends GraphCommand_1.default {
|
|
|
133
128
|
return;
|
|
134
129
|
}
|
|
135
130
|
setTimeout(() => {
|
|
136
|
-
this.waitUntilFinished(requestOptions, resolve, reject, logger
|
|
131
|
+
this.waitUntilFinished(requestOptions, resolve, reject, logger);
|
|
137
132
|
}, this.pollingInterval);
|
|
138
133
|
}).catch(err => reject(err));
|
|
139
134
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.session = void 0;
|
|
4
|
+
const crypto = require("crypto");
|
|
5
|
+
const cache_1 = require("./cache");
|
|
6
|
+
exports.session = {
|
|
7
|
+
getId(pid) {
|
|
8
|
+
const key = `${pid.toString()}_session`;
|
|
9
|
+
let sessionId = cache_1.cache.getValue(key);
|
|
10
|
+
if (sessionId) {
|
|
11
|
+
return sessionId;
|
|
12
|
+
}
|
|
13
|
+
sessionId = crypto.randomBytes(24).toString('base64');
|
|
14
|
+
cache_1.cache.setValue(key, sessionId);
|
|
15
|
+
return sessionId;
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=session.js.map
|
package/dist/utils/spo.js
CHANGED
|
@@ -56,7 +56,7 @@ exports.spo = {
|
|
|
56
56
|
});
|
|
57
57
|
});
|
|
58
58
|
},
|
|
59
|
-
waitUntilFinished({ operationId, siteUrl, resolve, reject, logger, currentContext,
|
|
59
|
+
waitUntilFinished({ operationId, siteUrl, resolve, reject, logger, currentContext, debug, verbose }) {
|
|
60
60
|
exports.spo
|
|
61
61
|
.ensureFormDigest(siteUrl, logger, currentContext, debug)
|
|
62
62
|
.then((res) => {
|
|
@@ -64,10 +64,6 @@ exports.spo = {
|
|
|
64
64
|
if (debug) {
|
|
65
65
|
logger.logToStderr(`Checking if operation ${operationId} completed...`);
|
|
66
66
|
}
|
|
67
|
-
if (!debug && verbose) {
|
|
68
|
-
dots += '.';
|
|
69
|
-
process.stdout.write(`\r${dots}`);
|
|
70
|
-
}
|
|
71
67
|
const requestOptions = {
|
|
72
68
|
url: `${siteUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
73
69
|
headers: {
|
|
@@ -101,7 +97,6 @@ exports.spo = {
|
|
|
101
97
|
reject,
|
|
102
98
|
logger,
|
|
103
99
|
currentContext,
|
|
104
|
-
dots,
|
|
105
100
|
debug,
|
|
106
101
|
verbose
|
|
107
102
|
});
|
|
@@ -109,7 +104,7 @@ exports.spo = {
|
|
|
109
104
|
}
|
|
110
105
|
});
|
|
111
106
|
},
|
|
112
|
-
waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger,
|
|
107
|
+
waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger, debug, verbose }) {
|
|
113
108
|
const requestUrl = `${siteUrl}/_api/site/GetCopyJobProgress`;
|
|
114
109
|
const requestOptions = {
|
|
115
110
|
url: requestUrl,
|
|
@@ -119,10 +114,6 @@ exports.spo = {
|
|
|
119
114
|
data: { "copyJobInfo": copyJobInfo },
|
|
120
115
|
responseType: 'json'
|
|
121
116
|
};
|
|
122
|
-
if (!debug && verbose) {
|
|
123
|
-
dots += '.';
|
|
124
|
-
process.stdout.write(`\r${dots}`);
|
|
125
|
-
}
|
|
126
117
|
request_1.default
|
|
127
118
|
.post(requestOptions)
|
|
128
119
|
.then((resp) => {
|
|
@@ -149,7 +140,7 @@ exports.spo = {
|
|
|
149
140
|
}
|
|
150
141
|
else {
|
|
151
142
|
setTimeout(() => {
|
|
152
|
-
exports.spo.waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger,
|
|
143
|
+
exports.spo.waitUntilCopyJobFinished({ copyJobInfo, siteUrl, pollingInterval, resolve, reject, logger, debug, verbose });
|
|
153
144
|
}, pollingInterval);
|
|
154
145
|
}
|
|
155
146
|
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# aad license list
|
|
2
|
+
|
|
3
|
+
Lists commercial subscriptions that an organization has acquired
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad license list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
--8<-- "docs/cmd/_global.md"
|
|
14
|
+
|
|
15
|
+
## Examples
|
|
16
|
+
|
|
17
|
+
List all licenses within the tenant
|
|
18
|
+
|
|
19
|
+
```sh
|
|
20
|
+
m365 aad license list
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Response
|
|
24
|
+
|
|
25
|
+
=== "JSON"
|
|
26
|
+
|
|
27
|
+
```json
|
|
28
|
+
[
|
|
29
|
+
{
|
|
30
|
+
"capabilityStatus": "Enabled",
|
|
31
|
+
"consumedUnits": 1,
|
|
32
|
+
"id": "48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df",
|
|
33
|
+
"skuId": "c7df2760-2c81-4ef7-b578-5b5392b571df",
|
|
34
|
+
"skuPartNumber": "ENTERPRISEPREMIUM",
|
|
35
|
+
"appliesTo": "User",
|
|
36
|
+
"prepaidUnits": {
|
|
37
|
+
"enabled": 10000,
|
|
38
|
+
"suspended": 0,
|
|
39
|
+
"warning": 0
|
|
40
|
+
},
|
|
41
|
+
"servicePlans": [
|
|
42
|
+
{
|
|
43
|
+
"servicePlanId": "8c098270-9dd4-4350-9b30-ba4703f3b36b",
|
|
44
|
+
"servicePlanName": "ADALLOM_S_O365",
|
|
45
|
+
"provisioningStatus": "Success",
|
|
46
|
+
"appliesTo": "User"
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
=== "Text"
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
id skuId skuPartNumber
|
|
57
|
+
------------------------------------------------------------------------- ------------------------------------ ----------------------
|
|
58
|
+
48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df c7df2760-2c81-4ef7-b578-5b5392b571df ENTERPRISEPREMIUM
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
=== "CSV"
|
|
62
|
+
|
|
63
|
+
```csv
|
|
64
|
+
id,skuId,skuPartNumber
|
|
65
|
+
48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df,c7df2760-2c81-4ef7-b578-5b5392b571df,ENTERPRISEPREMIUM
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
=== "Markdown"
|
|
69
|
+
|
|
70
|
+
```md
|
|
71
|
+
# aad license list
|
|
72
|
+
|
|
73
|
+
Date: 14/2/2023
|
|
74
|
+
|
|
75
|
+
## 48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df
|
|
76
|
+
|
|
77
|
+
Property | Value
|
|
78
|
+
---------|-------
|
|
79
|
+
capabilityStatus | Enabled
|
|
80
|
+
consumedUnits | 1
|
|
81
|
+
id | 48a80680-7326-48cd-9935-b556b81d3a4e_c7df2760-2c81-4ef7-b578-5b5392b571df
|
|
82
|
+
skuId | c7df2760-2c81-4ef7-b578-5b5392b571df
|
|
83
|
+
skuPartNumber | ENTERPRISEPREMIUM
|
|
84
|
+
appliesTo | User
|
|
85
|
+
prepaidUnits | {"enabled":10000,"suspended":0,"warning":0}
|
|
86
|
+
servicePlans | [{"servicePlanId":"8c098270-9dd4-4350-9b30-ba4703f3b36b","servicePlanName": "ADALLOM_S_O365","provisioningStatus": "Success","appliesTo": "User"}]
|
|
87
|
+
```
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# aad user add
|
|
2
|
+
|
|
3
|
+
Creates a new user
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad user add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--displayName <displayName>`
|
|
14
|
+
: The name to display in the address book for the user.
|
|
15
|
+
|
|
16
|
+
`--userName <userName>`
|
|
17
|
+
: The user principal name (someuser@contoso.com).
|
|
18
|
+
|
|
19
|
+
`--accountEnabled [accountEnabled]`
|
|
20
|
+
: Whether the account is enabled. Possible values: `true`, `false`. Default value is `true`.
|
|
21
|
+
|
|
22
|
+
`--mailNickname [mailNickname]`
|
|
23
|
+
: The mail alias for the user. By default this value will be extracted from `userName`.
|
|
24
|
+
|
|
25
|
+
`--password [password]`
|
|
26
|
+
: The password for the user. When not specified, a password will be generated.
|
|
27
|
+
|
|
28
|
+
`--firstName [firstName]`
|
|
29
|
+
: The given name (first name) of the user. Maximum length is 64 characters.
|
|
30
|
+
|
|
31
|
+
`--lastName [lastName]`
|
|
32
|
+
: The user's surname (family name or last name). Maximum length is 64 characters.
|
|
33
|
+
|
|
34
|
+
`--forceChangePasswordNextSignIn`
|
|
35
|
+
: Whether the user should change his/her password on the next login.
|
|
36
|
+
|
|
37
|
+
`--forceChangePasswordNextSignInWithMfa`
|
|
38
|
+
: Whether the user should change his/her password on the next login and setup MFA.
|
|
39
|
+
|
|
40
|
+
`--usageLocation [usageLocation]`
|
|
41
|
+
: A two letter [country code](https://learn.microsoft.com/en-us/partner-center/commercial-marketplace-co-sell-location-codes#country-and-region-codes) (ISO standard 3166). Required for users that will be assigned licenses.
|
|
42
|
+
|
|
43
|
+
`--officeLocation [officeLocation]`
|
|
44
|
+
: The office location in the user's place of business.
|
|
45
|
+
|
|
46
|
+
`--jobTitle [jobTitle]`
|
|
47
|
+
: The user's job title. Maximum length is 128 characters.
|
|
48
|
+
|
|
49
|
+
`--companyName [companyName]`
|
|
50
|
+
: The company name which the user is associated. The maximum length is 64 characters.
|
|
51
|
+
|
|
52
|
+
`--department [department]`
|
|
53
|
+
: The name for the department in which the user works. Maximum length is 64 characters.
|
|
54
|
+
|
|
55
|
+
`--preferredLanguage [preferredLanguage]`
|
|
56
|
+
: The preferred language for the user. Should follow [ISO 639-1 Code](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a). Example: `en-US`.
|
|
57
|
+
|
|
58
|
+
`--managerUserId [managerUserId]`
|
|
59
|
+
: User ID of the user's manager. Specify `managerUserId` or `managerUserName` but not both.
|
|
60
|
+
|
|
61
|
+
`--managerUserName [managerUserName]`
|
|
62
|
+
: User principal name of the manager. Specify `managerUserId` or `managerUserName` but not both.
|
|
63
|
+
|
|
64
|
+
--8<-- "docs/cmd/_global.md"
|
|
65
|
+
|
|
66
|
+
## Remarks
|
|
67
|
+
|
|
68
|
+
!!! important
|
|
69
|
+
To use this command you must be a Global administrator, User administrator or Privileged Authentication administrator
|
|
70
|
+
|
|
71
|
+
!!! note
|
|
72
|
+
After running this command, it may take a minute before the user is effectively created in the tenant.
|
|
73
|
+
|
|
74
|
+
## Examples
|
|
75
|
+
|
|
76
|
+
Create a user and let him/her update the password at first login
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --forceChangePasswordNextSignIn
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Create a user with job information
|
|
83
|
+
|
|
84
|
+
```sh
|
|
85
|
+
m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation Vosselaar --forceChangePasswordNextSignIn
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Create a user with language information
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --preferredLanguage "nl-BE" --usageLocation BE --forceChangePasswordNextSignIn
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Create a user with a manager
|
|
95
|
+
|
|
96
|
+
```sh
|
|
97
|
+
m365 aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --managerUserName "adele@contoso.com"
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Response
|
|
101
|
+
|
|
102
|
+
=== "JSON"
|
|
103
|
+
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"id": "990e2425-f595-43bc-85ed-b89a44093793",
|
|
107
|
+
"businessPhones": [],
|
|
108
|
+
"displayName": "John Doe",
|
|
109
|
+
"givenName": "John",
|
|
110
|
+
"jobTitle": "Sales Manager",
|
|
111
|
+
"mail": null,
|
|
112
|
+
"mobilePhone": null,
|
|
113
|
+
"officeLocation": "Vosselaar",
|
|
114
|
+
"preferredLanguage": "nl-BE",
|
|
115
|
+
"surname": "Doe",
|
|
116
|
+
"userPrincipalName": "john.doe@contoso.com",
|
|
117
|
+
"password": "SomePassw0rd"
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
=== "Text"
|
|
122
|
+
|
|
123
|
+
```text
|
|
124
|
+
businessPhones : []
|
|
125
|
+
displayName : John Doe
|
|
126
|
+
givenName : John
|
|
127
|
+
id : 990e2425-f595-43bc-85ed-b89a44093793
|
|
128
|
+
jobTitle : Sales Manager
|
|
129
|
+
mail : null
|
|
130
|
+
mobilePhone : null
|
|
131
|
+
officeLocation : Vosselaar
|
|
132
|
+
password : SomePassw0rd
|
|
133
|
+
preferredLanguage: nl-BE
|
|
134
|
+
surname : Doe
|
|
135
|
+
userPrincipalName: john.doe@contoso.com
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
=== "CSV"
|
|
139
|
+
|
|
140
|
+
```csv
|
|
141
|
+
id,businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,password
|
|
142
|
+
990e2425-f595-43bc-85ed-b89a44093793,[],John Doe,John,Sales Manager,,,Vosselaar,nl-BE,Doe,john.doe@contoso.com,SomePassw0rd
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
=== "Markdown"
|
|
146
|
+
|
|
147
|
+
```md
|
|
148
|
+
# aad user add --displayName "John Doe" --userName "john.doe@contoso.com" --password "SomePassw0rd" --firstName "John" --lastName "Doe" --jobTitle "Sales Manager" --officeLocation "Vosselaar" --preferredLanguage "nl-BE"
|
|
149
|
+
|
|
150
|
+
Date: 16/02/2023
|
|
151
|
+
|
|
152
|
+
## John Doe (990e2425-f595-43bc-85ed-b89a44093793)
|
|
153
|
+
|
|
154
|
+
Property | Value
|
|
155
|
+
---------|-------
|
|
156
|
+
id | 990e2425-f595-43bc-85ed-b89a44093793
|
|
157
|
+
businessPhones | []
|
|
158
|
+
displayName | John Doe
|
|
159
|
+
givenName | John
|
|
160
|
+
jobTitle | Sales Manager
|
|
161
|
+
mail | null
|
|
162
|
+
mobilePhone | null
|
|
163
|
+
officeLocation | Vosselaar
|
|
164
|
+
preferredLanguage | nl-BE
|
|
165
|
+
surname | Doe
|
|
166
|
+
userPrincipalName | john.doe@contoso.com
|
|
167
|
+
password | SomePassw0rd
|
|
168
|
+
```
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# aad user license add
|
|
2
|
+
|
|
3
|
+
Assigns a license to a user
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad user license add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--userId [userId]`
|
|
14
|
+
: The ID of the user. Specify either `userId` or `userName` but not both.
|
|
15
|
+
|
|
16
|
+
`--userName [userName]`
|
|
17
|
+
: User principal name of the user. Specify either `userId` or `userName` but not both.
|
|
18
|
+
|
|
19
|
+
`--ids <ids>`
|
|
20
|
+
: A comma separated list of IDs that specify the licenses to add.
|
|
21
|
+
|
|
22
|
+
--8<-- "docs/cmd/_global.md"
|
|
23
|
+
|
|
24
|
+
## Remarks
|
|
25
|
+
|
|
26
|
+
!!! important
|
|
27
|
+
The user must have a `usageLocation` value in order to assign a license to it.
|
|
28
|
+
|
|
29
|
+
## Examples
|
|
30
|
+
|
|
31
|
+
Assign specific licenses to a specific user by UPN
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
m365 user license add --userName "john.doe@contoso.com" --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Assign specific licenses from a specific user by ID
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
m365 user license add --userId "5c241023-2ba5-4ea8-a516-a2481a3e6c51" --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Response
|
|
44
|
+
|
|
45
|
+
=== "JSON"
|
|
46
|
+
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"businessPhones": [],
|
|
50
|
+
"displayName": "John Doe",
|
|
51
|
+
"givenName": null,
|
|
52
|
+
"jobTitle": null,
|
|
53
|
+
"mail": "John@contoso.onmicrosoft.com",
|
|
54
|
+
"mobilePhone": null,
|
|
55
|
+
"officeLocation": null,
|
|
56
|
+
"preferredLanguage": null,
|
|
57
|
+
"surname": null,
|
|
58
|
+
"userPrincipalName": "John@contoso.onmicrosoft.com",
|
|
59
|
+
"id": "eb77fbcf-6fe8-458b-985d-1747284793bc"
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
=== "Text"
|
|
64
|
+
|
|
65
|
+
```text
|
|
66
|
+
businessPhones : []
|
|
67
|
+
displayName : John Doe
|
|
68
|
+
givenName : null
|
|
69
|
+
id : eb77fbcf-6fe8-458b-985d-1747284793bc
|
|
70
|
+
jobTitle : null
|
|
71
|
+
mail : John@contoso.onmicrosoft.com
|
|
72
|
+
mobilePhone : null
|
|
73
|
+
officeLocation : null
|
|
74
|
+
preferredLanguage: null
|
|
75
|
+
surname : null
|
|
76
|
+
userPrincipalName: John@contoso.onmicrosoft.com
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
=== "CSV"
|
|
80
|
+
|
|
81
|
+
```csv
|
|
82
|
+
businessPhones,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName,id
|
|
83
|
+
[],John Doe,,,John@contoso.onmicrosoft.com,,,,,John@contoso.onmicrosoft.com,eb77fbcf-6fe8-458b-985d-1747284793bc
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
=== "Markdown"
|
|
87
|
+
|
|
88
|
+
```md
|
|
89
|
+
# aad user license add --userName "John@contoso.onmicrosoft.com" --ids "f30db892-07e9-47e9-837c-80727f46fd3d,606b54a9-78d8-4298-ad8b-df6ef4481c80"
|
|
90
|
+
|
|
91
|
+
Date: 16/2/2023
|
|
92
|
+
|
|
93
|
+
## John Doe (eb77fbcf-6fe8-458b-985d-1747284793bc)
|
|
94
|
+
|
|
95
|
+
Property | Value
|
|
96
|
+
---------|-------
|
|
97
|
+
businessPhones | []
|
|
98
|
+
displayName | John Doe
|
|
99
|
+
givenName | null
|
|
100
|
+
jobTitle | null
|
|
101
|
+
mail | John@contoso.onmicrosoft.com
|
|
102
|
+
mobilePhone | null
|
|
103
|
+
officeLocation | null
|
|
104
|
+
preferredLanguage | null
|
|
105
|
+
surname | null
|
|
106
|
+
userPrincipalName | John@contoso.onmicrosoft.com
|
|
107
|
+
id | eb77fbcf-6fe8-458b-985d-1747284793bc
|
|
108
|
+
```
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# aad user license list
|
|
2
|
+
|
|
3
|
+
Lists the license details for a given user
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad user license list [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--userId [userId]`
|
|
14
|
+
: The ID of the user. Specify either `userId` or `userName` but not both.
|
|
15
|
+
|
|
16
|
+
`--userName [userName]`
|
|
17
|
+
: User principal name of the user. Specify either `userId` or `userName` but not both.
|
|
18
|
+
|
|
19
|
+
--8<-- "docs/cmd/_global.md"
|
|
20
|
+
|
|
21
|
+
## Remarks
|
|
22
|
+
|
|
23
|
+
!!! tip
|
|
24
|
+
If you don't specify any option, the command will list the license details of the current logged in user. This does not work when using application permissions.
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
List license details of the current logged in user.
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
m365 aad user license list
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
List license details of a specific user by its UPN.
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
m365 aad user license list --userName john.doe@contoso.com
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
List license details of a specific user by its ID.
|
|
41
|
+
|
|
42
|
+
```sh
|
|
43
|
+
m365 aad user license list --userId 59f80e08-24b1-41f8-8586-16765fd830d3
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Response
|
|
47
|
+
|
|
48
|
+
=== "JSON"
|
|
49
|
+
|
|
50
|
+
```json
|
|
51
|
+
[
|
|
52
|
+
{
|
|
53
|
+
"id": "x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw",
|
|
54
|
+
"skuId": "c42b9cae-ea4f-4ab7-9717-81576235ccac",
|
|
55
|
+
"skuPartNumber": "DEVELOPERPACK_E5",
|
|
56
|
+
"servicePlans": [
|
|
57
|
+
{
|
|
58
|
+
"servicePlanId": "7547a3fe-08ee-4ccb-b430-5077c5041653",
|
|
59
|
+
"servicePlanName": "YAMMER_ENTERPRISE",
|
|
60
|
+
"provisioningStatus": "Success",
|
|
61
|
+
"appliesTo": "User"
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
=== "Text"
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
id : x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw
|
|
72
|
+
skuId : c42b9cae-ea4f-4ab7-9717-81576235ccac
|
|
73
|
+
skuPartNumber: DEVELOPERPACK_E5
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
=== "CSV"
|
|
77
|
+
|
|
78
|
+
```csv
|
|
79
|
+
id,skuId,skuPartNumber
|
|
80
|
+
x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw,c42b9cae-ea4f-4ab7-9717-81576235ccac,DEVELOPERPACK_E5
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
=== "Markdown"
|
|
84
|
+
|
|
85
|
+
```md
|
|
86
|
+
# aad user license list --userId "0c9c625f-faa9-4c3b-8cd8-d874b869f78c"
|
|
87
|
+
|
|
88
|
+
Date: 2/19/2023
|
|
89
|
+
|
|
90
|
+
## x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw
|
|
91
|
+
|
|
92
|
+
Property | Value
|
|
93
|
+
---------|-------
|
|
94
|
+
id | x4s03usaBkSMs5fbAhyttK6cK8RP6rdKlxeBV2I1zKw
|
|
95
|
+
skuId | c42b9cae-ea4f-4ab7-9717-81576235ccac
|
|
96
|
+
skuPartNumber | DEVELOPERPACK\_E5
|
|
97
|
+
servicePlans | [{"servicePlanId":"7547a3fe-08ee-4ccb-b430-5077c5041653","servicePlanName":"YAMMER\_ENTERPRISE","provisioningStatus":"Success","appliesTo":"User"}]
|
|
98
|
+
```
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# aad user license remove
|
|
2
|
+
|
|
3
|
+
Removes a license from a user
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 aad user license remove [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--userId [userId]`
|
|
14
|
+
: The ID of the user. Specify either `userId` or `userName` but not both.
|
|
15
|
+
|
|
16
|
+
`--userName [userName]`
|
|
17
|
+
: User principal name of the user. Specify either `userId` or `userName` but not both.
|
|
18
|
+
|
|
19
|
+
`--ids <ids>`
|
|
20
|
+
: A comma separated list of IDs that specify the licenses to remove.
|
|
21
|
+
|
|
22
|
+
`--confirm`
|
|
23
|
+
: Don't prompt for confirmation.
|
|
24
|
+
|
|
25
|
+
--8<-- "docs/cmd/_global.md"
|
|
26
|
+
|
|
27
|
+
## Examples
|
|
28
|
+
|
|
29
|
+
Remove specific licenses from a specific user by UPN
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
m365 user license remove --userName "john.doe@contoso.com" --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f"
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Remove specific licenses from a specific user by ID
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
m365 user license remove --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --ids "45715bb8-13f9-4bf6-927f-ef96c102d394,bea13e0c-3828-4daa-a392-28af7ff61a0f"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Response
|
|
42
|
+
|
|
43
|
+
The command won't return a response on success.
|