[REWST - TASK] Add M365 Groups And Shared Mailboxes

This workflow automates the important task of adding users to Microsoft 365 groups like security, distribution, and mail-enabled groups, and setting up shared mailboxes. It's a flexible building block for larger automations like employee onboarding or department changes. Use it to standardize how users get access during onboarding, role changes, or when spinning up project teams. The workflow checks what each group or mailbox needs, then runs the right subworkflows to add users, with error handling built in to keep things running smoothly. Its modular design makes it easy to plug into broader automations, so MSPs can manage Microsoft 365 more consistently and at scale across clients.

This workflow contains 11 tasks.

Inputs

  • automap - boolean

    • Auto-maps shared Mailboxes to Outlook Profile

    • Default: {{ true }}

  • gbl_groups - array

    • Assign M365 Licenses by adding user to License-Enabled M365 Groups (Will be listed here)

    • Default: {{ [ ] }}

  • aad_user_id - string

    • Azure Active Directory User ID

  • shared_mailboxes - array

    • Shared Mailbox Access

    • Default: {{ [ ] }}

  • mail_enabled_groups - array

    • Mail-Enabled Groups

    • Default: {{ [ ] }}

  • m365_direct_licenses - array

    • Directly Select Licenses from these current MS Subscriptions

    • Default: {{ [ ] }}

  • m365_security_groups - array

    • Azure Active Directory Security Groups

    • Default: {{ [ ] }}

  • m365_distribution_groups - array

    • Azure Active Directory Distribution Groups

    • Default: {{ [ ] }}

  • shared_mailboxes_allow_send_as - boolean

    • ㅤAllow send as the Shared Mailboxes?

    • Default: {{ false}}

  • shared_mailboxes_allow_send_on_behalf - boolean

    • Allow Send on Behalf of the Shared Mailboxes?

    • Default: {{ false}}

Outputs

  • automation_log: Standardized Rewst automation log

Key tasks

  • check_mail_enabled_groups: Validation/verification

  • add_to_m365_security_group: Workflows integration: [REWST - TASK] M365: Add User to Security Group

  • check_m365_security_groups: Validation/verification

  • failure_catch: Core integration: noop

  • check_shared_mailboxes: Validation/verification

Jinja examples

Example 1

{{ CTX.mail_enabled_groups|d([],true)|length > 0 }}

Used in transition condition

Example 2

{{ CTX.m365_distribution_groups|d([],true)|length > 0 }}

Used in transition condition

Last updated

Was this helpful?