Skip to content

Commit

Permalink
Adds engage community user add. Closes #6293
Browse files Browse the repository at this point in the history
  • Loading branch information
MathijsVerbeeck committed Oct 2, 2024
1 parent d126736 commit a84916c
Show file tree
Hide file tree
Showing 8 changed files with 781 additions and 0 deletions.
67 changes: 67 additions & 0 deletions docs/docs/cmd/viva/engage/engage-community-user-add.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# viva engage community user add

Adds a user to a specific Microsoft 365 Viva Engage community

## Usage

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

## Options

```md definition-list
`-i, --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`.

`--ids [ids]`
: Microsoft Entra IDs of users. You can also pass a comma-separated list of IDs. Specify either `ids` or `userNames` but not both.

`--userNames [userNames]`
: The user principal names of users. You can also pass a comma-separated list of UPNs. Specify either `ids` or `userNames` but not both.

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

`-r, --role <role>`
: The role to be assigned to the new users. Valid values: `Admin`, `Member`.
```

<Global />

## Examples

Add a single user specified by ID as a member to a community specified by display name.

```sh
m365 viva engage community user add --communityDisplayName "All company" --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member
```

Add multiple users specified by ID as members to a community specified by ID.

```sh
m365 viva engage community user add --communityId eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIzNjAyMDAxMTAwOSJ9 --ids "098b9f52-f48c-4401-819f-29c33794c3f5,f1e06e31-3abf-4746-83c2-1513d71f38b8" --role Member
```

Add a single user specified by UPN as an admin to a community specified by display name.

```sh
m365 viva engage community user add --communityDisplayName "All company" --userNames john.doe@contoso.com --role Admin
```

Adds multiple users specified by UPN as admins to a community specified by its group ID.

```sh
m365 viva engage community user add --entraGroupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --userNames "john.doe@contoso.com,adele.vance@contoso.com" --role Admin
```

## Response

The command won't return a response on success.
5 changes: 5 additions & 0 deletions docs/src/config/sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4475,6 +4475,11 @@ const sidebars: SidebarsConfig = {
label: 'engage community list',
id: 'cmd/viva/engage/engage-community-list'
},
{
type: 'doc',
label: 'engage community user add',
id: 'cmd/viva/engage/engage-community-user-add'
},
{
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 @@ -5,6 +5,7 @@ export default {
ENGAGE_COMMUNITY_ADD: `${prefix} engage community add`,
ENGAGE_COMMUNITY_GET: `${prefix} engage community get`,
ENGAGE_COMMUNITY_LIST: `${prefix} engage community list`,
ENGAGE_COMMUNITY_USER_ADD: `${prefix} engage community user add`,
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
1 change: 1 addition & 0 deletions src/m365/viva/commands/engage/Community.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ export interface Community {
displayName: string;
description?: string;
privacy: string;
groupId: string;
}
Loading

0 comments on commit a84916c

Please sign in to comment.