Exchange 2007 distribution list memeber count

Is there a get command that I can use to get a count of how many members are in an Exchange 2007 distribution group?
Who is Participating?
dsolarisConnect With a Mentor Commented:
Save the tets into notepad and save it as a file, say c:\groupcount.ps1.
Open EMS and enter: C:\groupcount.ps1.
Try this.  Simple input and output.

$groupname = Read-Host "Please Enter a Group Name"
$grpcount = 0
$data = Get-DistributionGroupMember -Identity $groupname
foreach ($i in $data)
      $grpcount = $grpcount + 1
write-output "Total Users in $($groupname):$grpcount"
33031aAuthor Commented:
So I ran this and got the following error:

Get-DistributionGroupMember : The operation could not be performed because object '$grpcount = 0' could not be found on domain controller 'domain controller name'.  
At line:1 char:36
+ $data = Get-DistributionGroupMember <<<< - Identity $groupname
Did you save it as a ps1 file and run it by calling the script?
33031aAuthor Commented:
Thank you.  It worked perfectly!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.