Comments on: Get Distribution Group Member Counts with PowerShell https://practical365.com/get-distribution-group-member-counts-with-powershell/ Practical Office 365 News, Tips, and Tutorials Fri, 26 Jul 2024 15:40:10 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_297309'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_297309"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-297309 Fri, 26 Jul 2024 15:40:10 +0000 https://www.practical365.com/?p=8730#comment-297309 In reply to SD.

And a simple search will find lots of examples, like https://office365itpros.com/2022/12/06/distribution-list-membership-sdk/

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_297307'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_297307"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-297307 Fri, 26 Jul 2024 15:29:10 +0000 https://www.practical365.com/?p=8730#comment-297307 In reply to SD.

I certainly could provide such a script, but you’ll find that it will take you a little time to write the script and at the end of the experience, you’ll feel much better that you did it rather than me.

]]>
By: SD https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-297305 Fri, 26 Jul 2024 15:07:58 +0000 https://www.practical365.com/?p=8730#comment-297305 Hi

Could you please provide an script to extract/report with all distribution groups (static and dynamic) with the following columns.

Displayname, Members Count, AcceptMessagesOnlyFrom, ModerationEnabled, ModeratedBy

]]>
By: Getting Exchange Online Distribution List Membership Counts with PowerShell https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-247733 Wed, 30 Nov 2022 15:49:29 +0000 https://www.practical365.com/?p=8730#comment-247733 […] often don’t work in the cloud. They even cited a Practical 365 article from 2015 telling how to report the number of members in distribution lists as an […]

]]>
By: Bhargav https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-237509 Tue, 11 Jan 2022 13:01:54 +0000 https://www.practical365.com/?p=8730#comment-237509 Hi Paul,

Thanks for the script.
when i am using below lines, its not counting the members in child groups. can you please help on it.

#Get distribution groups
$distgroups = @(Get-ADObject -LDAPFilter “(&(objectclass=group)(mail=*))” -Properties name, distinguishedName, managedby, mail)

#Process each distribution group
foreach ($dg in $distgroups)
{
$count = @(Get-ADGroup $dg.distinguishedname -Properties member |Select-Object -ExpandProperty member|Get-ADObject -Properties Samaccountname,DistinguishedName |select Samaccountname,DistinguishedName,ObjectClass).Count

]]>
By: <div class="apbct-real-user-wrapper"> <div class="apbct-real-user-author-name">Tony Redmond</div> <div class="apbct-real-user-badge" onmouseover=" let popup = document.getElementById('apbct_trp_comment_id_236880'); popup.style.display = 'inline-flex'; "> <div class="apbct-real-user-popup" id="apbct_trp_comment_id_236880"> <div class="apbct-real-user-title"> <p class="apbct-real-user-popup-header">The Real Person!</p> <p class="apbct-real-user-popup-text">Author <b>Tony Redmond</b> acts as a real person and passed all tests against spambots. Anti-Spam by CleanTalk.</p> </div> </div> </div> </div> https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-236880 Tue, 19 Oct 2021 15:32:59 +0000 https://www.practical365.com/?p=8730#comment-236880 In reply to Seifer Almasy.

That’s the count of objects in the DL. It doesn’t expand nested DLs into their members.

]]>
By: Seifer Almasy https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-236875 Tue, 19 Oct 2021 10:04:31 +0000 https://www.practical365.com/?p=8730#comment-236875 For O365 users just use this :

(Get-DistributionGroupMember -Identity “Name of your group”).count

]]>
By: Dilip Sasikumar https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-213418 Mon, 17 Jun 2019 16:20:00 +0000 https://www.practical365.com/?p=8730#comment-213418 In reply to Dilip Sasikumar.

Thought This might help people who has more than 5000 member’s groups

#Get distribution groups
$distgroups = @(Get-ADObject -LDAPFilter “(&(objectclass=group)(mail=*))” -Properties name, distinguishedName, managedby, mail)

#Process each distribution group
foreach ($dg in $distgroups)
{
$count = @(Get-ADGroup $dg.distinguishedname -Properties member |Select-Object -ExpandProperty member|Get-ADObject -Properties Samaccountname,DistinguishedName |select Samaccountname,DistinguishedName,ObjectClass).Count

]]>
By: Dilip Sasikumar https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-213054 Fri, 14 Jun 2019 19:01:00 +0000 https://www.practical365.com/?p=8730#comment-213054 In reply to Tom.

any workaround for this restriction of 5000?

]]>
By: Gino https://practical365.com/get-distribution-group-member-counts-with-powershell/#comment-200340 Tue, 09 Apr 2019 15:19:22 +0000 https://www.practical365.com/?p=8730#comment-200340 Hi , Is there a way to use the script if i dont have exchange on Prem? We use o #65 Exchange and we synch AD to Azure .

]]>