Export Office 365 Nested Distribution Group Members using PowerShell

Export Office 365 Nested Distribution Group Members using PowerShell

A Distribution Group is used to send emails to multiple recipients at once (both internal and external users) that are particularly significant for providing support to users. Efficiently adding members to the Distribution group is crucial to maximizing productivity.

Managing more efficiently the distribution groups comes with the use of nested distribution groups. In this blog let me guide you through to know what are nested distribution groups, where they can be used, and how to export nested distribution group members.

What are Nested Distribution Lists?

Adding a distribution list to another distribution list is defined as a Nested Distribution List. Nested distribution lists are intended to aid in,

  • Minimizing the replication traffic within the tenant. If you’re looking out to send the same messages to multiple groups, you can start using nested distribution lists.

When the members of the groups are known, we can determine whether the users are in the correct group or not. It is therefore imperative to export the members of the group.

Exporting Office 365 Distribution Group Members is easy, but what about exporting nested distribution group members?

How to Export Nested Distribution List Members?

To Export the nested distribution group members’ details are one of the foremost errands to work. It takes a long time to acquire information because you have to navigate each group. As a result, the GUI mode is unable to export the information.

PowerShell comes in handy here! The Get-DistributionGroup and Get-DistributionGroupMember cmdlets let you retrieve direct members only. If you want to retrieve nested distribution group membership, you’ll need to loop through multiple cmdlets and filters, but this process is a bit hectic.

Thus, our PowerShell script made this task much facile for you! With two types of reports provided by our script, you can get deep insights into your nested distribution group membership.

  1. Nested Distribution Group Summary Report
  2. Detailed Nested Distribution Group Membership Report.

Script Highlights:

  • The script uses modern authentication to connect to Exchange Online.
  • The script can be executed with MFA enabled account.
  • Primarily, the script exports nested distribution group members in two well-formatted CSV files – One with detailed information and another with summary information.
  • Automatically installs the EXO V2 module (if not installed already) upon your confirmation.
  • The script is scheduler-friendly, so worry not! i.e., credentials can be passed as parameters rather than being saved inside the script.

How to Execute the Script?

To run this script, you can choose any one of the below methods.

Method 1: You can use the below method to run the script with both MFA and non-MFA accounts.


Method 2: To run a script non-interactively (i.e., Scheduler-friendly), you can use the below format

.\GetNestedDistributionGroupMembers.ps1 -UserName [email protected] -Password XXX

Nested Distribution Group Members Report – Sample Outputs:

Once you run the script, it’ll export two output files. The output file will be stored in the current working directory.

  1. Office 365 Nested Distribution Group Summary Report.
  2. Detailed Office 365 Nested Distribution Group Membership Report.

O365 Nested Distribution Group Summary Report:

The summary report gives an overall outlook on the details of the Office 365 Nested Distribution groups. It has the following attributes.

  • Distribution Group Name
  • Nested Distribution Group Name
  • No of Members in the Nested Group
  • Nested Group Members
  • Nested Group Members ID

export nested distribution group members - summary report

Detailed O365 Nested Distribution Group Membership Report:

The detailed report provides a full report on each of the nested distribution groups, including the total number of members as well as their names.

The detailed report gives the in-depth reports with the following attributes:

  • Distribution Group Name
  • No Of Nested Group
  • Total Members
  • Nested Distribution Group Name
  • Group Members
  • Group Members’ ID

export nested distribution group - detailed report

Get More Extensive Reports With AdminDroid:

Specifically, if you need further sliced reports on nested distribution groups or any other groups, I suggest taking a look at AdminDroid Office 365 reporting software. For groups, it provides detailed reports on the following category,

Group Types:

  • Security Groups
  • Distribution Groups
  • Mail Enabled Groups
  • Synced Groups
  • Cloud Groups
  • Dynamic Distribution Groups

Group Membership:

  • Office 365 Group User Members
  • Distribution Group Members
  • Nested Distribution Group Members
  • Groups with Contacts as Members
  • Office 365 Group Hidden Membership

Audit Membership Changes:

  • Group Member Changes
  • Group Owner Changes

Inactive Distribution Groups based on

  • Last Email Received
  • Last Internal Email Received
  • Last External Email Received

We’re not stopping here! AdminDroid allows you to search by user, each group, each type, and more for whatever you need. AdminDroid has 1500+ reports with aesthetically attractive smart dashboards and a birds-eye perspective. It gives extensive information on audits, analytics, usage data, security, etc. With this tool, you can quickly get all sorts of reports about your Microsoft 365 environment.

AdminDroid export nested distribution group members

Free Office 365 reporting tool by AdminDroid provides reports on the organization’s groups, group membership, group membership change, users, licenses, user logins, password changes, etc. The free version contains 100+ reports and dashboards. Download AdminDroid now and start reaping the rewards!

I hope that this blog has given you a better understanding of how to obtain the details of an Office 365 nested distribution group.

Export Office 365 Nested Distribution Group Members using PowerShell

by Pavithra time to read: 3 min