exchange 2010

Get count of members  of mail universal distribution group
pramod1Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

StuartTechnical Architect - CloudCommented:
Get-DistributionGroupMember -Identity "group name"
Senior IT System EngineerIT ProfessionalCommented:
Can you please elaborate little bit more ?

is it the count total of member per group in your AD or just one particular only ?
CamyCommented:
To get the number specifically you can run something like the below in the mangement shell;

[PS] C:\Windows\system32>$members = Get-DistributionGroupMember "My Group Name"
[PS] C:\Windows\system32>$members.count

Open in new window

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

pramod1Author Commented:
get count of members of 1 particular distribution group
StuartTechnical Architect - CloudCommented:
Camy's suggestion is your best bet then
pramod1Author Commented:
I need to get count of members of one particular universal distribution in exchange management shell
pramod1Author Commented:
not working
StuartTechnical Architect - CloudCommented:
What is your group name
CamyCommented:
You getting an error when trying to run it?
pramod1Author Commented:
iHRMF15staff
pramod1Author Commented:
when I type in shell Get-DistributionGroupMember "Ihrmf15staff"

I get members

but when I typr ihrmf15staff.count it throws error
CamyCommented:
You need to read the results of the "get" cmdlet into a variable first.

$members = Get-DistributionGroupMember "Ihrmf15staff"

then on a new line: $members.count

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
StuartTechnical Architect - CloudCommented:
you must be doing something wrong - see example

Capture.PNG
pramod1Author Commented:
thanks , I got through command Get-DistributionGroupMember "Ihrmf15staff

list of members . I want to send this list to my boss how should I send it
StuartTechnical Architect - CloudCommented:
You can run a Get-DistributionGroupMember again but export to csv

Eg Get-DistributionGroupMember "group name" | Export-Csv c:\report.csv
pramod1Author Commented:
thanks one last question it send in csv format how should I open can is end in txt format
StuartTechnical Architect - CloudCommented:
If you want it in text format export the command using

Get-DistributionGroupMember "Groupname" > C:\report.txt
CamyCommented:
csv files will open in either Excel or Notepad without an issue.
pramod1Author Commented:
it doesn't open in readable format
pramod1Author Commented:
like I can read but not relate user column user properly
pramod1Author Commented:
I am attaching the report
report.csv
pramod1Author Commented:
my boss just needed count which we did  and username and email address of members in this group

in txt or excel format so he can see
StuartTechnical Architect - CloudCommented:
I would remove that file a lot of confidential data in there!
pramod1Author Commented:
so can u provide power shell so I can display only username and email address and export
StuartTechnical Architect - CloudCommented:
Try Get-DistributionGroupMember "Groupname" | FT Displayname,Emailaddress | Export-csv C:\Export.csv
StuartTechnical Architect - CloudCommented:
Edit your comment and x on the attachment
pramod1Author Commented:
please find it is jumbled
Export.csv
StuartTechnical Architect - CloudCommented:
Ok so I tested this and the following worked best for me

Get-DistributionGroupMember "Groupname" | fl displayname,Emailaddress > c:\report.txt

I then opened excel and imported from text file
pramod1Author Commented:
you opened excel and imported?
pramod1Author Commented:
thanks I don't see email address though
pramod1Author Commented:
may that distribution group is having one emai address, I guess
StuartTechnical Architect - CloudCommented:
Try the command without the export parameter, confirm it shows on the shell, check your spellings
pramod1Author Commented:
email address  doesn't show up in shell when I type $members = Get-DistributionGroupMember "Ihrmf15staff"
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.