o365reports.com Open in urlscan Pro
2606:4700:3031::6815:392b  Public Scan

URL: https://o365reports.com/2022/04/19/list-all-the-distribution-groups-a-user-is-member-of-using-powershell/
Submission Tags: falconsandbox
Submission: On February 22 via api from US — Scanned from DE

Form analysis 1 forms found in the DOM

POST #mc_signup

<form method="post" action="#mc_signup" id="mc_signup_form">
  <input type="hidden" id="mc_submit_type" name="mc_submit_type" value="js">
  <input type="hidden" name="mcsf_action" value="mc_submit_signup_form">
  <input type="hidden" id="_mc_submit_signup_form_nonce" name="_mc_submit_signup_form_nonce" value="915d735529">
  <div class="mc_form_inside">
    <div class="updated" id="mc_message">
    </div>
    <div class="mc_merge_var">
      <label for="mc_mv_EMAIL" class="mc_var_label mc_header mc_header_email">Email Address</label>
      <input type="text" size="18" placeholder="" name="mc_mv_EMAIL" id="mc_mv_EMAIL" class="mc_input">
    </div>
    <div style="display:none;"></div>
    <div style="display:none;"></div>
    <div class="mc_signup_submit">
      <input type="submit" name="mc_signup_submit" id="mc_signup_submit" value="Subscribe Now" class="button">
    </div>
  </div>
</form>

Text Content

OFFICE 365 REPORTS

All about Office 365





LIST ALL THE DISTRIBUTION GROUPS A USER IS MEMBER OF USING POWERSHELL

June 29, 2022June 29, 2022Exchange Online, O365 Powershell, Office 365, Office
365 Reports7 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 the users to the groups 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 DOWNLOAD: GETDISTRIBUTIONGROUPS_USERISMEMBEROF.PS1

 

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.


PowerShell

.\GetDistributionGroups_UserIsMemberOf.ps1
1
.\GetDistributionGroups_UserIsMemberOf.ps1

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



PowerShell

.\GetDistributionGroups_UserIsMemberOf.ps1 -UserName admin@contoso.com -Password
XXX
1
.\GetDistributionGroups_UserIsMemberOf.ps1 -UserName admin@contoso.com -Password
XXX

 


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.



 

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
 * Distribution Group Membership for a Single User
 * DL membership for a List of Input Users

 


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.


PowerShell

.\GetDistributionGroups_UserIsMemberOf.ps1
1
.\GetDistributionGroups_UserIsMemberOf.ps1

 


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.


PowerShell

.\GetDistributionGroups_UserIsMemberOf.ps1 -UserPrincipalName AdeleV@contoso.com
1
.\GetDistributionGroups_UserIsMemberOf.ps1 -UserPrincipalName AdeleV@contoso.com

 


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.


PowerShell

.\GetDistributionGroups_UserIsMemberOf.ps1 -InputCsvFilePath “.\import.csv"
1
.\GetDistributionGroups_UserIsMemberOf.ps1 -InputCsvFilePath “.\import.csv"


Sample Input CSV file:

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



You can opt to find the user membership among all the Office 365 Groups rather
than identifying only within distribution groups. It will efficiently manage
your time, and admins can ensure enterprise security and assign correct
permissions to users.

 


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.



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!





YOU MAY ALSO LIKE THESE BLOGS:

Get List of All Teams a User Is Member Of Advantage of Office 365 Groups over
Traditional Distribution Groups Export Office 365 Groups a User is Member Of
Using PowerShell Upgrade Distribution Lists to Microsoft 365 Groups Using
PowerShell Start Teams Chat with Distribution Lists and Other Groups Exchange
Online Tenant Allow and Block List Management





POST NAVIGATION

Office 365 Vs Microsoft 365: Exploring the Differences
Get MFA Status of Office 365 Users Using Microsoft Graph PowerShell  




CATEGORIES

 * Exchange Online
 * News
 * O365 Powershell
 * Office 365
 * Office 365 Education
 * Office 365 Reports
 * Security
 * SharePoint Online
 * Tools


SUBSCRIBE FOR LATEST UPDATE

Email Address





RECENT POSTS

 * Upgrade Distribution Lists to Microsoft 365 Groups Using PowerShell February
   21, 2023
 * A Guide to Manage Named Locations in Conditional Access Policies. February
   17, 2023
 * Multiple Ways to Get Built-in SharePoint Online Sharing Reports in M365
   February 7, 2023
 * Concurrent Exchange Online License Assignments Now Made Easy! January 31,
   2023
 * Streams Classic Retirement and Migration to Stream on SharePoint January 24,
   2023

Proudly powered by WordPress | Theme: Doo by ThemeVS.

Exchange Online


LIST ALL THE DISTRIBUTION GROUPS A USER IS MEMBER OF USING POWERSHELL

by PaVee time to read: 4 min
O365 Powershell Get MFA Status of Office 365 Users Using Microsof…
Office 365 Office 365 Vs Microsoft 365: Exploring the Differe…
 * 
 * 
 * 
 * 

Follow us!