105 - Improve Group Management to Support Exchange
Sign up for our LIVE training sessions below!
⚠️ These steps assume you have completed the full steps from Rewst 104 You can find the instructions to make this form on the Rewst 104 Page
Add a Get Group Action
- 1.Open the Add or Remove from AzureAD Group workflow.
- 2.Add a Get Group action from the Microsoft Graph category.
- 3.Move the Get Group action to top of the workflow.
- 4.Rename the Get Group action to "get_group".
- 5.Set Group ID to
{{ CTX.group_id }}
under Parameters. - 6.Click the On Success transition of Get Group.
- 7.Create a Data Alias:
- Key:
group
- Value:
{{RESULT.result.data.value}}
Create a Fork in the Workflow
- 1.Add a noop below the get_group action to create a new fork in the workflow.
- 2.Connect the On Success transition from get_group to the new noop.
- 3.Click the noop.
- 4.Rename the noop "check_group_type".
- 5.Click Advanced.
- 6.Set the Transition Mode to Follow First.
Identify Dynamic Membership Groups
- 1.Click the On Success transition on check_group_type.
- 2.Add "Dynamic Group" as the Custom Label.
- 3.Set the Custom Condition as
{{ "DynamicMembership" in CTX.group.groupTypes }}
.
Identify Unified and non-Mail Enabled Groups
- 1.Add another transition labeled "Graph" for check_group_type.
- 2.Set the Custom Condition as
{{ "Unified" in CTX.group.groupTypes or not CTX.group.mailEnabled }}
. - 3.Connect the Graph transition to the add_or_remove noop.
Add a Transition for Exchange Online Managed Groups
- 1.Add another transition labeled Exchange Online for check_group_type.
- 2.Copy adding_or_removing.
- 3.Rename the copy to "adding_or_removing_exo".
- 4.Move adding_or_removing_exo below and to the right of check_group_type.
- 5.Connect the Exchange Online transition from check_group_type to adding_or_removing_exo.
Implement Add-DistributionGroupMember
- 1.Add an InvokeCommand action from the Microsoft Exchange category.
- 2.Move the InvokeCommand action under the Add transition of adding_or_removing_exo.
- 3.Connect the Add transition to the InvokeCommand action.
- 4.Click the InvokeCommand action.
- 5.Rename the action "exo_add_group_member"
- 6.Enter
Add-DistributionGroupMember
for Cmdlet Name. - 7.Add the parameters:
- Member:
{{ CTX.user_id }}
- Identity:
{{ CTX.group_id }}
- BypassSecurityGroupManagerCheck:
{{ true }}
Implement Remove-DistributionGroupMember
- 1.Copy exo_add_group_member.
- 2.Click the copied exo_add_group_member.
- 3.Rename the action "exo_remove_group_member"
- 4.Move exo_remove_group_member under the Remove transition of adding_or_removing_exo.
- 5.Connect the Remove transition to the exo_remove_group_member action.
- 6.Enter
Remove-DistributionGroupMember
for Cmdlet Name - 7.Check the parameters are set:
- Member:
{{ CTX.user_id }}
- Identity:
{{ CTX.group_id }}
- BypassSecurityGroupManagerCheck:
{{ true }}
Output Variable Setup
- 1.Click Configure Workflow Variable (Pencil icon)
- 2.Add an Output Variable:
- Field Name:
group_result
- Value:
{{ CTX.group_result }}
- 3.Click Submit.
- 4.Click Configure Workflow Variable to exit.
Add On Success and On Failure Messages to _microsoft_graph_add_group_member_
- 1.Click the On Success transition for microsoft_graph_add_group_member.
- 2.Create a Data Alias:
- Key:
group_result
- Value: User was added to MS Graph Group
{{ CTX.group.displayName | d }}
.
- 3.Add a new transition.
- 4.Click the new transition.
- 5.Click On Failure under Condition.
- 6.Add a Data Alias:
- Key:
group_result
- Value: Failed adding the user to Graph Group
{{ CTX.group.displayName | d }}
.
Add On Success and On Failure Messages to _microsoft_graph_remove_group_member_
- 1.Click the On Success transition for microsoft_graph_remove_group_member.
- 2.Create a Data Alias:
- Key:
group_result
- Value: User was removed from MS Graph Group
{{ CTX.group.displayName | d }}
.
- 3.Add a new transition.
- 4.Click the new transition.
- 5.Click On Failure under Condition.
- 6.Add a Data Alias:
- Key:
group_result
- Value: Failed removing the user from Graph Group
{{ CTX.group.displayName | d }}
.
Add On Success and On Failure Messages to _exo_add_group_member_
- 1.Click the On Success transition for exo_add_group_member.
- 2.Add a Data Alias:
- Key:
group_result
- Value: User was added to Exchange Group
{{ CTX.group.displayName | d }}
.
- 3.Add a new transition.
- 4.Click the new transition.
- 5.Click On Failure under Condition.
- 6.Add a Data Alias:
- Key:
group_result
- Value: Failed adding the user to Exchange Group
{{ CTX.group.displayName | d }}
.
Add On Success and On Failure Messages to _exo_remove_group_member_
- 1.Click the On Success transition for exo_remove_group_member.
- 2.Add a Data Alias:
- Key:
group_result
- Value: User was removed from Exchange Group
{{ CTX.group.displayName | d }}
.
- 3.Add a new transition.
- 4.Click the new transition.
- 5.Click On Failure under Condition.
- 6.Create a Data Alias:
- Key:
group_result
- Value: Failed removing the user from Exchange Group
{{ CTX.group.displayName | d }}
.
Add an On Failure Message for get_group
- 1.Create a new transition for get_group.
- 2.Click the new transition.
- 3.Click On Failure under Condition.
- 4.Add a Data Alias:
- Key:
group_result
- Value: Failed to get Group information for
{{ CTX.group_id }}
.
Add a Message for Dynamic Groups
- 1.Click the Dynamic Group transition on check_group_type
- 2.Add a Data Alias:
- Key:
group_result
- Value: The Group
{{ CTX.group.displayName | d }}
is a Dynamic Group and can not be directly modified. You will need to edit its Membership Rules to modify this.
Add a Finish to the Workflow
- 1.Add a noop towards the bottom of the workflow.
- 2.Click the newly added noop.
- 3.Rename the noop "finish".
- 4.Set the Task Transition Criteria Sensitivity to 1 under Advanced.
- 5.Connect the transitions from graph_add_group_member, graph_remove_group_member, exo_add_group_member, and exo_remove_group_member to the finish noop.
For more information on Microsoft Exchange PowerShell Commandlets, check out their documentation: