Script to Get the member counts in all DL which are enabled for receiving external emails

=====================================================================

#Script to Get the member counts in all DL which are enabled for receiving external emails

#Start Script

Start-transcript C:\Results_DLMembercount.txt
$DistGrp = Get-DistributionGroup -resultsize “Unlimited” | where {$_.RequireSenderAuthenticationEnabled -eq “True”}
Foreach ($DistGrp in $DistGrp)
{
$DLName = $DistGrp.DisplayName
$Members = Get-DistributionGroupMember “$DistGrp”
$Count = $Members.count
$Count = “$DLName” + “ = “ + “$Count”
$Count
}
Stop-Transcript

#End of Script

==============================================================

 

2 thoughts on “Script to Get the member counts in all DL which are enabled for receiving external emails

  1. Hi Ganesh

    We have around 135 DLs created and we are running a project for consolidation. We have got the list of DLs, however we would like to get the members from each DL into excel. Could you please provide your feedback.

Leave a comment