Updated 4 months ago

List All the Distribution Groups a User Is Member of Using PowerShell

by PaVee

4 min read

No Comments

Distribution groups are a major source of lowering administrative effort. When an admin can list all the distribution groups user is a member of, most of his tasks are simplified. If you are having trouble figuring out which distribution groups a particular user is a part of, this blog may be what you need. Continue reading to find your ideal answer!

Purpose of Generating User Group Membership Report:

  • Can know whether the users belong to the right groups swiftly.
  • Adding, removing, and managing group owners and users are the critical tasks of the administrators. Having the “user member of” report readily available reduces the administrative workload. You can easily identify their presence in a group.

Get Distribution Groups a User Is Member Of:

Consider a scenario where there are many users or employees in your organization, and you want to identify who belongs to which distribution group. To be precise, “How to find all the distribution groups, a user is a member of?” This might look like a tedious task to look upon, right?

Yes, it is! But worry not!! We’re here to help you out. As Office 365 UI mode lacks the option to find bulk users at a while, plus it can’t distinguish among the different types of groups. It is a vain attempt and also a bit-time consuming.

Find Distribution Lists a User Is Member of With PowerShell:

With PowerShell, you can list all the distribution groups a user is a member of. But, you need to use multiple PowerShell cmdlets like Get-DistributionGroup and Get-DistributionGroupMember in a loop. If you are a PowerShell novice, you might have difficulty getting the desired results.

To simplify your work, we’ve prepared a PowerShell script that streamlines the process of figuring out which distribution groups the users belong to.

Script Highlights:

  • The script uses modern authentication to connect to Exchange Online.
  • The script can be executed with MFA enabled account
  • Automatically installs the EXO V2 module (if not installed already) upon your confirmation.
  • Credentials are passed as parameters, so worry not!
  • Allows generating user membership reports based on your requirement.
    • DL membership for all users.
    • DL membership for a list of users (import CSV).
    • DL membership for a single user.

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.

Distribution Lists a User Is Member of – Sample Output:

The exported distribution group report has the following attributes:

  • User Principal Name
  • User Display Name
  • No of DLs User Is a Member
  • Distribution List Name
  • Distribution List Email Address

The output file will be stored in the current working directory.

Distribution Group A User is Member Of

Unlock the Full Potential of the script:

It will retrieve all the users and their distribution group membership and retrieve the distribution group membership of particular input users through an input CSV file.

List All Users and Their Distribution Groups:

Once you run the script, it’ll automatically export all the distribution groups of all the user is member of, regardless of classification.

Distribution Group Membership for a Single User:

Say, you want to identify the distribution group, to which AdeleV@contoso.com belongs. You can mention the UserPrincipalName while running the script. It’ll export the total number of DLs and the distribution group names to where the user belongs to.

If you find that the user is a member of many inactive distribution groups, consider removing them from those groups.

DL Membership for a List of Users (Import CSV):

If you’re looking out to export the distribution groups of certain users, you can import the –UserPrincipalName of the users in a CSV file. Use the parameter –InputCsvFilePath and mention the CSV file path. This will eventually export the distribution groups of the list of users.


Sample Input CSV file:

The administrator can provide the UserPrincipalName as the input (reference below).

list all distribution groups a user is member of - import file

You can opt to find user memberships among all Office 365 groups and identify user memberships within security groups & mail-enabled security groups rather than just identifying them within DLs. In this way, admins can easily find which users are in which groups and revoke unnecessary permissions!

Get More Extensive Reports with AdminDroid:

If you’re about to get more detailed reports on distribution group membership as well as more accurate information on other groups. Then give the tool, AdminDroid, a shot. 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

Plus, much more! It generates exhaustive reports on all of the groups and activities related to each group for whatever you need. You can schedule, customize using the filters, and require reports of your needs. AdminDroid provides over 1500+ all-inclusive reports on Office 365 reporting, auditing, analytics, usage statistics, security & compliance, and a lot more, all with an easy-to-use interface that effortlessly handles all of your complex tasks.

AdminDroid, Distribution user is member of

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.

Start your 15-day free pack now, and experience the features of AdminDroid!

I hope that this blog helped you understand how to identify the membership of users within distribution groups. Make use of this script and secure your users by placing them in the right group!

Share article