Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: viva engage community add. Closes #5753 #5976

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
170 changes: 170 additions & 0 deletions docs/docs/cmd/viva/engage/engage-community-add.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# viva engage community add

Creates a new community in Viva Engage.

## Usage

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

## Options

```md definition-list
`--displayName <displayName>`
: The name of the community. The maximum length is 255 characters.

`--description <description>`
: The description of the community. The maximum length is 1024 characters.

`--privacy <privacy>`
: Defines the privacy level of the community. The possible values are: public, and private.

`--adminEntraIds [adminEntraIds]`
: Comma-separated list of Microsoft Entra IDs, assigning admin privileges to the designated individuals. Required when using application permissions. Specify either adminEntraIds or adminEntraUserNames, but not both.

`--adminEntraUserNames [adminEntraUserNames]`
: Comma-separated list of Microsoft Entra UPNs, assigning admin privileges to the designated individuals. Required when using application permissions. Specify either adminEntraIds or adminEntraUserNames, but not both.

`--wait`
: Wait for the operation to finish.
```

<Global />

## Remarks

:::warning

This command is based on an API that is currently in preview and is subject to change once the API reached general availability.

:::

It is limited to networks in Native mode only - legacy and external Yammer networks will not be able to use this API for community creation.

Creating a community will create a linked Microsoft 365 unified group as well.

In order to use this command, you need to grant the Microsoft Entra application used by the CLI for Microsoft 365 the permission to the Viva Engage API. To do this, execute the `cli consent --service VivaEngage` command.

## Examples

Create a public community and wait for the community to be created

```sh
m365 viva engage community add --displayName "Software engineers" --description "A community for all software engineers" --privacy public --wait
```

Create a private community

```sh
m365 viva engage community add --displayName "Software engineers" --description "A community for all software engineers" --privacy private
```

Create a private community with owners

```sh
m365 viva engage community add --displayName "Software engineers" --description "A community for all software engineers" --privacy private --adminEntraUserNames "john.doe@contoso.onmicrosoft.com,jane.doe@contoso.onmicrosoft.com"
```

## Response

### With --wait:

<Tabs>
<TabItem value="JSON">

```json
{
"id": "eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI2ODgxMGQ4ZS1lODk2LTRhNzEtYWM5NC02NGIyZThlMmMyOGUiLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ",
"createdDateTime": "2024-04-10T12:16:18.0240578Z",
"lastActionDateTime": "2024-04-10T12:16:18.0240592Z",
"status": "succeeded",
"statusDetail": null,
"resourceLocation": "https://graph.microsoft.com/beta/employeeExperience/communities('eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODQ4MTMxNTAyMDgifQ')",
"operationType": "createCommunity",
"resourceId": "eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODQ4MTMxNTAyMDgifQ"
}
```

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

```text
createdDateTime : 2024-04-10T12:45:03.4020639Z
id : eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI5NzRkMjUzZS1jMGUzLTQ2YjgtYTkzMy0zZDZhODU1NGE0OWUiLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ
lastActionDateTime: 2024-04-10T12:45:03.4020656Z
operationType : createCommunity
resourceId : eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODQ4MTUwNTA3NTIifQ
resourceLocation : https://graph.microsoft.com/beta/employeeExperience/communities('eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODQ4MTUwNTA3NTIifQ')
status : succeeded
statusDetail : null
```

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

```csv
id,createdDateTime,lastActionDateTime,status,statusDetail,resourceLocation,operationType,resourceId
eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiJiMDU0MjFmNC0zNzU5LTQ3NzgtOTVhYi01NzhiYjAzZGNiMWQiLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ,2024-04-12T11:24:29.074105Z,2024-04-12T11:24:29.0741064Z,succeeded,,https://graph.microsoft.com/beta/employeeExperience/communities('eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODUwMTc2NzE2ODAifQ'),createCommunity,eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODUwMTc2NzE2ODAifQ
```

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

```md
# viva engage community add --displayName "Software engineers" --description "A community for all software engineers" --privacy "private" --wait "true"

Date: 10/04/2024

## eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI5ZTgzMDRjMC1mZmY0LTRkODgtYTM4OS1mNDY0MmQ3OGZlMTciLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ

Property | Value
---------|-------
id | eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI5ZTgzMDRjMC1mZmY0LTRkODgtYTM4OS1mNDY0MmQ3OGZlMTciLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ
createdDateTime | 2024-04-10T12:47:47.3488087Z
lastActionDateTime | 2024-04-10T12:47:47.3488107Z
status | succeeded
resourceLocation | https://graph.microsoft.com/beta/employeeExperience/communities('eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODQ4MTUyMzkxNjgifQ')
operationType | createCommunity
resourceId | eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiIxODQ4MTUyMzkxNjgifQ
```

</TabItem>
</Tabs>

### Without --wait:

<Tabs>
<TabItem value="JSON">

```json
https://graph.microsoft.com/beta/employeeExperience/engagementAsyncOperations('eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI4ZmM2NzEyZS0wMWY4LTQxN2YtYWNmMS1iZTJiYmMxY2FjNGQiLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ')
```

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

```text
https://graph.microsoft.com/beta/employeeExperience/engagementAsyncOperations('eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI4ZmM2NzEyZS0wMWY4LTQxN2YtYWNmMS1iZTJiYmMxY2FjNGQiLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ')
```

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

```csv
https://graph.microsoft.com/beta/employeeExperience/engagementAsyncOperations('eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI4ZmM2NzEyZS0wMWY4LTQxN2YtYWNmMS1iZTJiYmMxY2FjNGQiLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ')
```

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

```md
https://graph.microsoft.com/beta/employeeExperience/engagementAsyncOperations('eyJfdHlwZSI6IkxvbmdSdW5uaW5nT3BlcmF0aW9uIiwiaWQiOiI4ZmM2NzEyZS0wMWY4LTQxN2YtYWNmMS1iZTJiYmMxY2FjNGQiLCJvcGVyYXRpb24iOiJDcmVhdGVDb21tdW5pdHkifQ')
```

</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 @@ -4286,6 +4286,11 @@ const sidebars: SidebarsConfig = {
label: 'engage search',
id: 'cmd/viva/engage/engage-search'
},
{
type: 'doc',
label: 'engage community add',
id: 'cmd/viva/engage/engage-community-add'
},
{
type: 'doc',
label: 'engage community get',
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 @@ -2,6 +2,7 @@ const prefix: string = 'viva';

export default {
CONNECTIONS_APP_CREATE: `${prefix} connections app create`,
ENGAGE_COMMUNITY_ADD: `${prefix} engage community add`,
ENGAGE_COMMUNITY_GET: `${prefix} engage community get`,
ENGAGE_GROUP_LIST: `${prefix} engage group list`,
ENGAGE_GROUP_USER_ADD: `${prefix} engage group user add`,
Expand Down