Office 365 (Microsoft Graph) Office 365 (Microsoft Graph): Groups

Summary

This module contains actions for managing groups in Office 365.

Mail-Enabled Groups

Unfortunately the Microsoft Graph API does not support creating or updating mail-enabled groups.

These groups can be audited & added to others, but they cannot be created or updated using this plugin.

See here for more information.

Actions

microsoft_graph.groups.

add_member

Add a member to a group.

Members can be Users or Groups.

If the member is already in the group, nothing will be modified & the action will succeed.

Minimum Plugin Version: 1.0.0

Input

Unified Groups

You cannot add Unified groups to Security groups.

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- microsoft_graph.groups.add_member:
  load:
    group_id: selected_group.id
    member_id: selected_user.id
    client: graph_secrets

microsoft_graph.groups.

create_security_group

Create a security group.

Minimum Plugin Version: 1.0.0

Input
  • client: a GraphClient

  • display_name: a display name for the group

  • mail_nickname: a mail alias for the group

  • owners: optional list of User IDs if setting owners (defaults to no owners)

  • users: optional list of User IDs to add as members

  • groups: optional list of Group IDs to add as members

Unified Groups

You cannot add Unified groups to Security groups.

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- microsoft_graph.groups.create:
    display_name: Example Group
    mail_nickname: example.group
  load:
    client: graph_secrets

microsoft_graph.groups.

delete

Delete a group.

Minimum Plugin Version: 1.0.0

Input
Output

Nothing is outputted by this action.

Example
1
2
3
4
- microsoft_graph.groups.delete:
  load:
    group_id: selected_group.id
    client: graph_secrets

microsoft_graph.groups.

display

Display groups in a table.

The table will have the following columns:

  • Display Name
  • Mail Nickname
  • Mail Enabled
  • Security Enabled
  • Type(s)

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • groups: any number of Groups

Output

Nothing is outputted by this action.

Example
1
2
3
4
5
6
7
8
9
- microsoft_graph.groups.get_all:
  load:
    client: graph_secrets
  save: groups

- microsoft_graph.groups.display:
    text: All Groups
  load:
    groups: groups

microsoft_graph.groups.

get_all

Get all groups.

Minimum Plugin Version: 1.0.0

Input
Output

A list of Groups.

Example
1
2
3
4
- microsoft_graph.groups.get_all:
  load:
    client: graph_secrets
  save: groups

microsoft_graph.groups.

get_by_display_name

Get all groups with the supplied display name.

Minimum Plugin Version: 1.1.0

Group display names are not unique!

Input
Output

A SearchResult containing:

  • total: the number of Groups found

  • all: a list of Groups found

  • first: the first Group found

  • last: the last Group found

Example
1
2
3
4
5
- microsoft_graph.groups.get_by_display_name:
  load:
    display_name: group.display_name
    client: graph_secrets
  save: search_result

microsoft_graph.groups.

get_by_id

Get the group with the supplied group ID.

Minimum Plugin Version: 1.1.0

Input
Output

A single Group.

Example
1
2
3
4
5
- microsoft_graph.groups.get_by_id:
  load:
    group_id: group.id
    client: graph_secrets
  save: group

microsoft_graph.groups.

get_groups

Get groups directly in the supplied group.

Minimum Plugin Version: 1.0.0

Input
Output

A list of Groups.

Example
1
2
3
4
5
- microsoft_graph.groups.get_groups:
  load:
    group_id: selected_group.id
    client: graph_secrets
  save: groups

microsoft_graph.groups.

get_users

Get users directly in the supplied group.

Minimum Plugin Version: 1.0.0

Input
Output

A list of Users.

Example
1
2
3
4
5
- microsoft_graph.groups.get_users:
  load:
    group_id: selected_group.id
    client: graph_secrets
  save: users

microsoft_graph.groups.

remove_member

Remove a member from a group.

Members can be Users or Groups.

If the member is not already in the group, nothing will be modified & the action will succeed.

Minimum Plugin Version: 1.0.0

Input
Output

Nothing is outputted by this action.

Example
1
2
3
4
5
- microsoft_graph.groups.remove_member:
  load:
    group_id: selected_group.id
    member_id: selected_user.id
    client: graph_secrets

microsoft_graph.groups.

select

Display groups in a table & prompt the task operator to make a selection.

The table will have the following columns:

  • Display Name
  • Mail Nickname
  • Mail Enabled
  • Security Enabled
  • Type(s)

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • groups: any number of Groups

  • minimum: the minimum number of selections

  • maximum: the maximum number of selections

Output

A Selection containing:

  • total: the number of selected Groups

  • all: a list of selected Groups

  • first: the first selected Groups

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
- microsoft_graph.groups.get_all:
  load:
    client: graph_secrets
  save: groups

- microsoft_graph.groups.select:
    text: Select Groups
  load:
    groups: groups
  save: selection

microsoft_graph.groups.

select_one

Display groups in a table & prompt the task operator to select one.

The table will have the following columns:

  • Display Name
  • Mail Nickname
  • Mail Enabled
  • Security Enabled
  • Type(s)

Minimum Plugin Version: 1.0.0

Input
  • text: the title of the table

  • groups: any number of Groups

Output

A single Group.

Example
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
- microsoft_graph.groups.get_all:
  load:
    client: graph_secrets
  save: groups

- microsoft_graph.groups.select_one:
    text: Select a Group
  load:
    groups: groups
  save: group