Skip to content

Commit

Permalink
Adds command 'viva engage community user list'. Closes #3908
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwaegebaert committed Sep 20, 2024
1 parent 9a7d76f commit 7df47c7
Show file tree
Hide file tree
Showing 10 changed files with 876 additions and 0 deletions.
123 changes: 123 additions & 0 deletions docs/docs/cmd/viva/engage/engage-community-user-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# viva engage community user list

Lists all users within a specified Microsoft 365 Viva Engage community

## Usage

```sh
m365 viva engage community user list [options]
```

## Options

```md definition-list
`--communityId [communityId]`
: The ID of the Viva Engage community. Specify `communityId`, `communityDisplayName` or `entraGroupId`.

`-n, --communityDisplayName [communityDisplayName]`
: The display name of the Viva Engage community. Specify `communityId`, `communityDisplayName` or `entraGroupId`.

`--entraGroupId [entraGroupId]`
: The ID of the Microsoft 365 group. Specify `communityId`, `communityDisplayName` or `entraGroupId`.

`-r, --role [role]`
: Filter the results to only users with the given role: `Admin`, `Member`.
```

<Global />

## Examples

List all users from a community specified by ID.

```sh
m365 viva engage community user list --communityId eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIzNjAyMDAxMTAwOSJ9
```

List all admins from a community specified by display name.

```sh
m365 viva engage community user list --communityDisplayName "All company" --role Admin
```

List all members from a community specified by group ID.

```sh
m365 viva engage community user list --entraGroupId b6c35b51-ebca-445c-885a-63a67d24cb53 --role Member
```

## Response

### Standard response

<Tabs>
<TabItem value="JSON">

```json
[
{
"id": "da634de7-d23c-4419-ab83-fcd395b4ebd0",
"businessPhones": [
"123-555-1215"
],
"displayName": "Anton Johansen",
"givenName": "Anton",
"jobTitle": "IT Manager",
"mail": null,
"mobilePhone": "123-555-6645",
"officeLocation": "123455",
"preferredLanguage": null,
"surname": "Johansen",
"userPrincipalName": "[email protected]",
"roles": [
"Admin"
]
}
]
```

</TabItem>
<TabItem value="Text">

```text
id displayName userPrincipalName roles
------------------------------------ ---------------- ----------------------------------------- ------
da634de7-d23c-4419-ab83-fcd395b4ebd0 Anton Johansen [email protected] Admin
```

</TabItem>
<TabItem value="CSV">

```csv
id,displayName,givenName,jobTitle,mail,mobilePhone,officeLocation,preferredLanguage,surname,userPrincipalName
da634de7-d23c-4419-ab83-fcd395b4ebd0,Anton Johansen,Anton,IT Manager,,123-555-6645,123455,,Johansen,[email protected]
```

</TabItem>
<TabItem value="Markdown">

```md
# viva engage community user list --entraGroupId "b6c35b51-ebca-445c-885a-63a67d24cb53"

Date: 19/9/2024

## Anton Johansen (da634de7-d23c-4419-ab83-fcd395b4ebd0)

Property | Value
---------|-------
id | da634de7-d23c-4419-ab83-fcd395b4ebd0
displayName | Anton Johansen
givenName | Anton
jobTitle | IT Manager
mobilePhone | 123-555-6645
officeLocation | 123455
surname | Johansen
userPrincipalName | [email protected]
```

</TabItem>
</Tabs>
5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4454,6 +4454,11 @@ const sidebars: SidebarsConfig = {
label: 'engage community get',
id: 'cmd/viva/engage/engage-community-get'
},
{
type: 'doc',
label: 'engage community user list',
id: 'cmd/viva/engage/engage-community-user-list'
},
{
type: 'doc',
label: 'engage group list',
Expand Down
1 change: 1 addition & 0 deletions src/m365/viva/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default {
CONNECTIONS_APP_CREATE: `${prefix} connections app create`,
ENGAGE_COMMUNITY_ADD: `${prefix} engage community add`,
ENGAGE_COMMUNITY_GET: `${prefix} engage community get`,
ENGAGE_COMMUNITY_USER_LIST: `${prefix} engage community user list`,
ENGAGE_GROUP_LIST: `${prefix} engage group list`,
ENGAGE_GROUP_USER_ADD: `${prefix} engage group user add`,
ENGAGE_GROUP_USER_REMOVE: `${prefix} engage group user remove`,
Expand Down
7 changes: 7 additions & 0 deletions src/m365/viva/commands/engage/Community.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export interface Community {
id: string;
displayName: string;
description?: string;
privacy: string;
groupId: string;
}
Loading

0 comments on commit 7df47c7

Please sign in to comment.