I want to create a dynamic distribution group for a VP which includes VP's direct reports and his direct report's direct reports and so on..

ShunmugaPriya Arunachalam 20 Reputation points
2023-09-14T13:42:04.7933333+00:00

I want to create a dynamic distribution group for a VP which includes VP's direct reports and his direct report's direct reports and so on until the last user has no direct reports.

Exchange Online
Exchange Online
A Microsoft email and calendaring hosted service.
6,182 questions
0 comments No comments
{count} votes

Accepted answer
  1. Yuki Sun-MSFT 41,376 Reputation points Moderator
    2023-09-15T02:55:07.94+00:00

    Hi @ShunmugaPriya Arunachalam ,

    I want to create a dynamic distribution group for a VP which includes VP's direct reports and his direct report's direct reports and so on until the last user has no direct reports.

    At present it's not possible to create a dynamic distribution group using direct reports query like this.

    Given this, I'd recommend trying to look for another shared attribute like "Department" or anything else which could be used to create a dynamic distribution group that can meet your need. If there's such an attribute in your scenario, you can consider manually creating a Dynamic distribution group for each manager, and then add them into a "root" DL.

    Below are the basic steps for your reference:

    1. Connect to Exchange Online Powershell, run the command below to list VP's direct reports and his direct report's direct reports and so on.
      Get-User <user> | select -ExpandProperty directreports
    2. Create Dynamic Distribution groups for each manager, from the down to top. Below is an example command, you'll need to adapt the example to fit your group name and the manager's distinguished name.
      New-DynamicDistributionGroup Manager01Group -RecipientFilter {(Manager -eq 'CN=user1,OU=xxxx.onmicrosoft.com,OU=Microsoft Exchange Hosted Organizations,DC=NAMPR10A005,DC=PROD,DC=OUTLOOK,DC=COM') -and (RecipientType -eq 'UserMailbox')}
    3. Create a Distribution Group as the root group for VP's group, add the dynamic distribution groups created in step2 into it.

    Here‘s another thread discussing the similar question for your reference. Eric shared a thought about using custom attributes as well, but it requires extra effort to deal with these attributes.
    https://learn.microsoft.com/en-us/answers/questions/205370/create-dynamic-distribution-group-based-on-manager


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.