Skip to content

Commit 7af59ba

Browse files
JwaegebaertMathijsVerbeeck
authored andcommitted
Adds command 'viva engage community user list'. Closes #6295
1 parent 24900d3 commit 7af59ba

File tree

8 files changed

+803
-3
lines changed

8 files changed

+803
-3
lines changed
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
import Global from '/docs/cmd/_global.mdx';
2+
import Tabs from '@theme/Tabs';
3+
import TabItem from '@theme/TabItem';
4+
5+
# viva engage community user list
6+
7+
Lists all users within a specified Microsoft 365 Viva Engage community
8+
9+
## Usage
10+
11+
```sh
12+
m365 viva engage community user list [options]
13+
```
14+
15+
## Options
16+
17+
```md definition-list
18+
`--communityId [communityId]`
19+
: The ID of the Viva Engage community. Specify `communityId`, `communityDisplayName` or `entraGroupId`.
20+
21+
`-n, --communityDisplayName [communityDisplayName]`
22+
: The display name of the Viva Engage community. Specify `communityId`, `communityDisplayName` or `entraGroupId`.
23+
24+
`--entraGroupId [entraGroupId]`
25+
: The ID of the Microsoft 365 group. Specify `communityId`, `communityDisplayName` or `entraGroupId`.
26+
27+
`-r, --role [role]`
28+
: Filter the results to only users with the given role: `Admin`, `Member`.
29+
```
30+
31+
<Global />
32+
33+
## Examples
34+
35+
List all users from a community specified by ID.
36+
37+
```sh
38+
m365 viva engage community user list --communityId eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIzNjAyMDAxMTAwOSJ9
39+
```
40+
41+
List all admins from a community specified by display name.
42+
43+
```sh
44+
m365 viva engage community user list --communityDisplayName "All company" --role Admin
45+
```
46+
47+
List all members from a community specified by group ID.
48+
49+
```sh
50+
m365 viva engage community user list --entraGroupId b6c35b51-ebca-445c-885a-63a67d24cb53 --role Member
51+
```
52+
53+
## Response
54+
55+
### Standard response
56+
57+
<Tabs>
58+
<TabItem value="JSON">
59+
60+
```json
61+
[
62+
{
63+
"id": "da634de7-d23c-4419-ab83-fcd395b4ebd0",
64+
"businessPhones": [
65+
"123-555-1215"
66+
],
67+
"displayName": "Anton Johansen",
68+
"givenName": "Anton",
69+
"jobTitle": "IT Manager",
70+
"mail": null,
71+
"mobilePhone": "123-555-6645",
72+
"officeLocation": "123455",
73+
"preferredLanguage": null,
74+
"surname": "Johansen",
75+
"userPrincipalName": "[email protected]",
76+
"roles": [
77+
"Admin"
78+
]
79+
}
80+
]
81+
```
82+
83+
</TabItem>
84+
<TabItem value="Text">
85+
86+
```text
87+
id displayName userPrincipalName roles
88+
------------------------------------ ---------------- ----------------------------------------- ------
89+
da634de7-d23c-4419-ab83-fcd395b4ebd0 Anton Johansen [email protected] Admin
90+
```
91+
92+
</TabItem>
93+
<TabItem value="CSV">
94+
95+
```csv
96+
id,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName
97+
da634de7-d23c-4419-ab83-fcd395b4ebd0,Anton Johansen,Anton,IT Manager,,123-555-6645,123455,,Johansen,[email protected]
98+
```
99+
100+
</TabItem>
101+
<TabItem value="Markdown">
102+
103+
```md
104+
# viva engage community user list --entraGroupId "b6c35b51-ebca-445c-885a-63a67d24cb53"
105+
106+
Date: 19/9/2024
107+
108+
## Anton Johansen (da634de7-d23c-4419-ab83-fcd395b4ebd0)
109+
110+
Property | Value
111+
---------|-------
112+
id | da634de7-d23c-4419-ab83-fcd395b4ebd0
113+
displayName | Anton Johansen
114+
givenName | Anton
115+
jobTitle | IT Manager
116+
mobilePhone | 123-555-6645
117+
officeLocation | 123455
118+
surname | Johansen
119+
userPrincipalName | [email protected]
120+
```
121+
122+
</TabItem>
123+
</Tabs>

docs/src/config/sidebars.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4499,6 +4499,11 @@ const sidebars: SidebarsConfig = {
44994499
label: 'engage community list',
45004500
id: 'cmd/viva/engage/engage-community-list'
45014501
},
4502+
{
4503+
type: 'doc',
4504+
label: 'engage community user list',
4505+
id: 'cmd/viva/engage/engage-community-user-list'
4506+
},
45024507
{
45034508
type: 'doc',
45044509
label: 'engage group list',

src/m365/viva/commands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export default {
55
ENGAGE_COMMUNITY_ADD: `${prefix} engage community add`,
66
ENGAGE_COMMUNITY_GET: `${prefix} engage community get`,
77
ENGAGE_COMMUNITY_LIST: `${prefix} engage community list`,
8+
ENGAGE_COMMUNITY_USER_LIST: `${prefix} engage community user list`,
89
ENGAGE_GROUP_LIST: `${prefix} engage group list`,
910
ENGAGE_GROUP_USER_ADD: `${prefix} engage group user add`,
1011
ENGAGE_GROUP_USER_REMOVE: `${prefix} engage group user remove`,
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export interface Community {
2-
id: string;
3-
displayName: string;
2+
id?: string;
3+
displayName?: string;
44
description?: string;
5-
privacy: string;
5+
privacy?: string;
6+
groupId?: string;
67
}

0 commit comments

Comments
 (0)