Score:0

Dynamic distribution group based or reporting hierarchy

kh flag

Is it possible to configure a dynamic distribution group to contain all direct reports of some person, plus all their direct reports recursively?

Verbose Info

To get the direct reports only I believe we'd just run:

Set-DynamicDistributionGroup -Identity 'SomeManagersDirectReports' `
    -RecipientFilter "((RecipientType -eq 'UserMailbox') -and (Manager -eq 'CN=SomeManager,OU=Users,DC=domain,DC=example,DC=com')" 

But to get a manager, their direct reports, and their reports recursively, the only way I can think of is to run something like the below to generate a list of members, then use that to update a (static) distribution group dynamically.

# very rough code to demo thinking... Haven't yet considered things like character escaping /
# circular loops / other fun things which may be found in the wild...

[string]$FirstPersonDn = 'CN=SomeManager,OU=Users,DC=domain,DC=example,DC=com'
[System.Collections.Generic.List[string]]$newMembers = [System.Collections.Generic.List[string]]::new()
[System.Collections.Generic.List[string]]$members = [System.Collections.Generic.List[string]]::new()
$newMembers.Add($FirstPersonDn)
while ($newMembers.Count) {
    $members.Add($newMembers)
    $newMembers = $newMembers | %{Get-AdUser $_ -properties DirectReports} | % DirectReports
}
Update-DistributionGroupMember -Identity 'SomeManagerAndTheirReportsRecusive' -Members $members
Score:0
us flag

Based on my research, recursively delivering emails to the direct reports of the managers who are in the dynamic distribution group is not available, you may only add all reports to the group or create dynamic distribution group for each manager and add these DDLs to the parent distribution group.

Here is a similar thread for your reference, hope it helps: Create dynamic distribution group based on manager

kh flag
Thank-you. If I've understood correctly; there would be no way for the membership of the parent group to dynamically which child groups were selected as the related top level manager's direct reports changed. You could set the group's `customAttributeX` to be the parent manager's name; so the parent manager's group filters on all child groups with `customAttributeX ='Me'`; but if that manager's direct reports changed, their reports' associated groups wouldn't automatically have their `customAttributeX` update to the new parent manager.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.