Solved

Exchange 2007 distribution list memeber count

Posted on 2008-10-22
5
1,001 Views
Last Modified: 2012-05-05
Is there a get command that I can use to get a count of how many members are in an Exchange 2007 distribution group?
0
Comment
Question by:33031a
  • 3
  • 2
5 Comments
 
LVL 3

Expert Comment

by:dsolaris
ID: 22778401
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"
0
 

Author Comment

by:33031a
ID: 22778560
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
0
 
LVL 3

Expert Comment

by:dsolaris
ID: 22778617
Did you save it as a ps1 file and run it by calling the script?
0
 
LVL 3

Accepted Solution

by:
dsolaris earned 500 total points
ID: 22778634
Save the tets into notepad and save it as a file, say c:\groupcount.ps1.
Open EMS and enter: C:\groupcount.ps1.
0
 

Author Closing Comment

by:33031a
ID: 31508806
Thank you.  It worked perfectly!
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Utilizing an array to gracefully append to a list of EmailAddresses
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
In this video we show how to create an Address List in Exchange 2013. We show this process by using the Exchange Admin Center. Log into Exchange Admin Center.: First we need to log into the Exchange Admin Center. Navigate to the Organization >> Ad…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now